[BUG] - Downloading video by DownloadURL/TikTok from array returns "Access denied" html file
See original GitHub issueBug description
Trying to download videos by random/specific hashtags, it returns a html code with error instead. Same trouble with music downloads.
The code I was trying to use:
hashtags = api.discoverHashtags()
chosen_hashtag = random.choice(hashtags)['cardItem']['title']
videos_by_hashtag = api.byHashtag(chosen_hashtag, count=10)
chosen_video = random.choice(videos_by_hashtag)
video = api.get_Video_By_TikTok(chosen_video, language='en')
with open('video.mp4', 'wb') as output:
output.write(video)
Error I’m getting written inside video.mp4
<HTML><HEAD>
<TITLE>Access Denied</TITLE>
</HEAD><BODY>
<H1>Access Denied</H1>
You don't have permission to access "http://v16-web.tiktok.com/video/tos/useast2a/tos-useast2a-ve-0068c004/2362532506c24a66be8a02a69273732d/?" on this server.<P>
Reference #18.e527bcd4.1607970961.2bc87a4
</BODY>
</HTML>
Is it possible that it’s trying to get video from US servers and banning me because of my location (Russia)? I tried to use US proxy and VPN though, no result. But somehow it downloads videos I get from api.trending method with no problems at all.
Desktop:
- OS: Windows 10
- TikTokApi Version: 3.8.6
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Access denied to get covers and video url #301
Today I saw that the URL of the videos and for covers are returning access denied when access. Anyone see the same?
Read more >Solved: "Access Denied" - Canvas Community
Solved: We are facing some big issues in showing HTML contents, all published in courses file manager, to a lot of canvas users....
Read more >Why when downloading html and save it as file on hard ...
Put breakpoint there, and you'll see "[ Access Denied #2 ]" instead of html content like seen in browser. There is no instant...
Read more >'Failed Forbidden' Error when Downloading From Google Drive
... try restarting your device. Your browser can't play this video. ... Fix: 'Failed Forbidden ' Error when Downloading From Google Drive.
Read more >403 Forbidden HTML Templates
403 access forbidden HTML template with animated SVG image. Compatible browsers: Chrome, Edge, Firefox, Opera, Safari. Dependencies: - ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue-Label Bot is automatically applying the label
bug
to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!Links: app homepage, dashboard and code for this bot.
There’s also a YouTube video in the readme that explains how to get a custom_verifyFp and another workaround although the code above should still work.