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] - Downloading video by DownloadURL/TikTok from array returns "Access denied" html file

See original GitHub issue

Bug 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&#58;&#47;&#47;v16&#45;web&#46;tiktok&#46;com&#47;video&#47;tos&#47;useast2a&#47;tos&#45;useast2a&#45;ve&#45;0068c004&#47;2362532506c24a66be8a02a69273732d&#47;&#63;" on this server.<P>
Reference&#32;&#35;18&#46;e527bcd4&#46;1607970961&#46;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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
issue-label-bot[bot]commented, Dec 14, 2020

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.

0reactions
davidteathercommented, Mar 20, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

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