-
Notifications
You must be signed in to change notification settings - Fork 27
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?] Error in video extraction: status code 10201 #58
Comments
Does the code work on any video that isn't a slideshow? |
Nope, the same error |
That's interesting. I'm not getting this error on my end, which leads me to believe it's a region specific thing. If you try to access TikTok on your PC without being logged in, does it try to force you to login? TikTok has been changing their privacy regulations to match EU restrictions, and I know part of that is that TikTok requires EU users to login. Although Belarus is not a member of the EU, I know there's some trade relations there with the EU, so there's likely similar privacy policies. It's also likely that TikTok might just be implementing the new restrictions across the whole EU. In either case, I'd be interested to see TikTok's standard behavior on your PC. |
Yeah, you are right. If I open a link in a browser without being logged in, a page opens and a video/slideshow starts playing, but immediately an authorization window pops up and then another one with captcha. Is there any way out of this situation without using a US VPN? For example, using browser cookies to bypass it like youtube-dl does. |
I haven't yet been able to figure out exactly what the right combination of cookies, headers, and paramstring parameters is in order to get around this. Interestingly, there's a difference in behavior in Europe between video pages and user pages (I confirmed that youtube-dl also has this issue with user pages). On a user page, you can't even see any of their videos or other information. It just takes you straight to a login page, as seen in #47. At least getting to see the video/slideshow before the login prompt pops up leads me to believe making those API requests are possible. The tricky part of this whole thing is that TikTok puts various signatures and checksums in the paramstrings of their API requests, and these are generated on the fly and are not always based on cookies. I'll keep looking into this. |
Got it, thanks. If any more information is needed on my end, I will be happy to help. |
* #58, #61 - Resolved status code 10201 appearing when extracting videos from mobile app share links * #59 - Suppressed two errors during user video iteration: * TypeError: `DeferredItemListIterator` no longer attempts to iterate over a None item_list * JSONDecodeError: `DeferredItemListIterator` cuts iteration short if an API request returns null JSON
This error should (hopefully) be fixed in version 0.2.2. It seems that the issue was actually related to a change I made to video extraction in 0.2.0. It looked for the video ID in the video URL, which is possible with a desktop URL, but the mobile app share links are shortened and don't contain that information. |
Thank you! This update definitely fixed this error, but the save_slideshow() method raises 403 Forbidden error, so I have rewriten the code from the documentation to use aiohttp with specified cookies in both save_video() and save_slideshow() methods:
With this code I can download any slideshow from any link (PC/Mobile), but a video can be downloaded only from a PC link. A mobile link returns:
|
This is a known issue that I'm working on. See #44. |
This may be fixed in version 0.2.4 with the video |
Describe the bug
Hello! I tried the code provided as an example in the documentation under "Download Videos and Slideshows" section to download slideshows, but I get the 10201 error on any link.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Slideshows can be downloaded
Version Information
pydantic==2.0.3
pydantic_core==2.3.0
playwright==1.36.0
tiktokapipy==0.2.1
System Information
Same behavior both on PC (Windows 11 22H2 , Python 3.11.4) and VPS (Ubuntu Server 22.04 LTS, Python 3.10.6)
Region Information
PC - Belarus
VPS - Germany
Additional context
Example links:
https://vm.tiktok.com/ZM2CEJ7Ba/
https://vm.tiktok.com/ZM2C51TKA/
https://vm.tiktok.com/ZM2CyJnWL/
The text was updated successfully, but these errors were encountered: