TikTok-Api: [BUG] - Video playAddr/downloadAddr video URL invalid

I am not able to access the video url in playAddr or downloadAdd by using the requests package.

Example playAddr/downloadAddr: url = https://v16-web-newkey.tiktokcdn.com/72bd098ebfeaa71c084919d3a55efd64/5f93f32e/video/tos/useast2a/tos-useast2a-ve-0068c003/6e2d74eb3de944a28013313625663e6f/?a=1988&br=5980&bt=2990&cr=0&cs=0&cv=1&dr=0&ds=3&er=&l=2020102403255301019020801232109270&lr=tiktok_m&mime_type=video_mp4&qs=0&rc=M3lzajV1czVodzMzaDczM0ApaDNkODs0ZTxkNzdlOzhkOmdhYi4tcDVkZTFfLS0xMTZzc2NfX18tYWIxMDFgMS1gXi86Yw%3D%3D&vl=&vr=

When trying to access: video_bytes = requests.get(url, headers={"User-Agent": "okhttp"}).content I get response: b'<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don\'t have permission to access "http&#58;&#47;&#47;v16&#45;web&#45;newkey&#46;tiktokcdn&#46;com&#47;72bd098ebfeaa71c084919d3a55efd64&#47;5f93f32e&#47;video&#47;tos&#47;useast2a&#47;tos&#45;useast2a&#45;ve&#45;0068c003&#47;6e2d74eb3de944a28013313625663e6f&#47;&#63;" on this server.<P>\nReference&#32;&#35;18&#46;bfa83617&#46;1603510554&#46;9d99b4\n</BODY>\n</HTML>\n'

Versioning:

  • Google Colab
  • TikTokApi Version 3.5.5 (3.5.6 was giving some weird errors about DevTools listening on ws://127.0.0.1:49147/devtools/browser/9a11fbf1-4032-42c0-95f3-5c22a8356070 [1024/035014.316372:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory so I used the prev version)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 24 (11 by maintainers)

Most upvoted comments

Yeah I’m getting the issue now. Working on a fix

The website itself doesn’t need a _signature parameter do download TikTok video but the api is generating it, why?

And I got it needs the tt_webid_2 cookie.

I basically need to:

  • Fetch user posts
  • Download all videos

For that what is the workaround because I don’t want to make extra call for each videeo.

I need use the same cookie to fetch user posts and download videos?

Using either of the two methods, I’m still getting the following error response:

b'<HTML><HEAD>\n<TITLE>Access Denied</TITLE>\n</HEAD><BODY>\n<H1>Access Denied</H1>\n \nYou don\'t have permission to access "http&#58;&#47;&#47;v16&#45;web&#45;newkey&#46;tiktokcdn&#46;com&#47;72bd098ebfeaa71c084919d3a55efd64&#47;5f93f32e&#47;video&#47;tos&#47;useast2a&#47;tos&#45;useast2a&#45;ve&#45;0068c003&#47;6e2d74eb3de944a28013313625663e6f&#47;&#63;" on this server.<P>\nReference&#32;&#35;18&#46;463819b8&#46;1603659279&#46;5ebfadf\n</BODY>\n</HTML>\n'