Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 403 Error when trying to download video from v16-webapp-prime.tiktok.com #517

Open
tonyquang opened this issue Nov 30, 2024 · 2 comments
Assignees
Labels
BUG Something isn't working enhancement New feature or request

Comments

@tonyquang
Copy link

tonyquang commented Nov 30, 2024

Platform where the error occurred?

TikTok

The endpoint where the error occurred?

https://www.tiktok.com/api/post/item_list

Submitted input value?

I made a fetch_user_post request to the above tiktok api and got this response

image

After that I get the first one resp["video"]["bitrateInfo"][0]["PlayAddr"]["UrlList"][0] and try to download it, but I got 403 error ( I used the same header request which includes my cookies and user agent of fetch_user_post function but still get the same error)

So I tried to debug and realized that seems like a relationship between the device_id and my cookie (login already) if I use the default (hard-coded one) of the BaseRequestModel device_id: int = 7380187414842836523 then cannot download the video (403 access denied) but if I use my real device_id (get from browser) and with my cookie then I can access and download the video

Correct me if I am wrong thanks !

@tonyquang tonyquang added BUG Something isn't working enhancement New feature or request labels Nov 30, 2024
@Evil0ctal
Copy link
Owner

Yes, in an update of TikTok Web about half a year ago, they added this restriction. Your summary and analysis are very accurate. This restriction is associated with device_id, but the APP interface is still available, so I did not deal with this issue. However, we can discuss how to solve this problem elegantly. Thank you for your feedback and summary!

@tonyquang
Copy link
Author

i found this endpoint that will return the wid in the response when we provide cookie and user-agent, I guess it is device_id
do you want take a look on it?
https://www.tiktok.com/api/v1/web-cookie-privacy/config?locale=en&appId=1988&theme=default&tea=1, we can get the device_id from user-agent and cookie in advance and store it somewhere for reusable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants