question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] - Access Denied get_Video_By_TikTok / get_Video_By_DownloadURL

See original GitHub issue

Describe the bug

<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>

You don't have permission to access "http&#58;&#47;&#47;v16&#45;web&#46;tiktok&#46;com&#47;video&#47;tos&#47;useast2a&#47;tos&#45;useast2a&#45;pve&#45;0068&#47;245415333a4041669d95e01b1f9ac9c9&#47;&#63;" on this server.<P>
Reference&#32;&#35;18&#46;8c997b68&#46;1611251007&#46;112bbf9f
</BODY>
</HTML>

The buggy code

from TikTokApi import TikTokApi
import re, requests
api = TikTokApi.get_instance()
video_url = 'https://vm.tiktok.com/ZMJwm6Kva'
video_id = re.match(r'https:\/\/m.tiktok.com\/v\/(.*)\.html', requests.get(video_url, allow_redirects=False).headers['Location']).group(1)
# 6890020588425907462
t_data = api.getTikTokById(video_id)
data = api.get_Video_By_TikTok(t_data)
# Returns Access Denied
'''
addr = t_data['itemInfo']['itemStruct']['video']['downloadAddr']
data = api.get_Video_By_DownloadURL(addr)
# Also returns access denied
'''

Expected behavior

Binary Data of video

Desktop (please complete the following information):

  • OS: Windows 10
  • TikTokApi Version [e.g. 3.3.1] - Current

Interesting to note that using the URL manually works, as in

data = api.get_Video_By_Url('https://www.tiktok.com/@hanime2.0/video/6890020588425907462')

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
retepscommented, Jan 28, 2021
    video_id = 'ZMJwqpTPq'
    c_did = ''.join(random.choice(string.digits) for num in range(19))
    id = re.match(r'https:\/\/m.tiktok.com\/v\/(.*)\.html', requests.get('https://vm.tiktok.com/' + video_id, allow_redirects=False).headers['Location']).group(1)
    t_data = api.getTikTokById(id, custom_did=c_did)
    addr = t_data['itemInfo']['itemStruct']['video']['downloadAddr']
    return api.get_Video_By_DownloadURL(addr, custom_did=c_did)
    ```
0reactions
kaan0ndercommented, Feb 3, 2021

same problem again. I get the playAddr as :

https://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-pve-0068/42379326697f49fd8380a0d5dccdfdab/?a=1988&br=992&bt=496&cd=0%7C0%7C1&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&expire=1612358534&l=2021020307215901011504022917417BB0&lr=tiktok_m&mime_type=video_mp4&pl=0&policy=2&qs=0&rc=ajk0Njpzcmp1MzMzODczM0ApaGVmZDNmOmQ7Nzs4aDdlM2dvNTAzYDU1bWBgLS0uMTZzcy8wLWEyXmEwYGIyMy5hLzM6Yw%3D%3D&signature=9cf2cf9045c24e9c2bf9decae5f96432&tk=tt_webid_v2&vl=&vr=

Could you send the screenshot when you access this page. I get error like NO VIDEO WITH SUPPORTED FORMAT AND MIME TYPE FOUND.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Video Kit with Web - TikTok for Developers | TikTok
Share Video API allows users to share videos from your Web or Desktop app into TikTok. Videos will be sent into users' inboxes...
Read more >
tiktok api get video url from post, video not showing
it is returning the json below, but all the urls there are not showing the actual video url that plays. it just shows...
Read more >
GitHub - drawrowfly/tiktok-scraper
This is just a scraper that is using TikTok Web API to scrape media and related meta ... getVideoMeta('WEB_VIDEO_URL', options) // Get video...
Read more >
TikTok Downloader, No Watermark Video Downloader For ...
TikTok Downloader. Download TikTok videos in MP4 format and save them to your phone, tablet or pc. Our video downloader for TikTok helps...
Read more >
How To AVOID Community Violations on TikTok ... - YouTube
How To AVOID Community Violations on TikTok & Appeal Banned Video | In today's video, we explain what happens when your video is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found