samirelanduk / tiktok-save

A Python tool for backing up your liked and bookmarked videos on tiktok to your computer.
90 stars 13 forks source link

Videos failing to download #1

Closed emCarCode closed 3 years ago

emCarCode commented 3 years ago

Thank you for writing this tool and making it freely available. I was looking forward to using it, but when I tried to use tiktok-save to download my liked videos I only ended up with a failures list, even though most of my liked videos are still viewable on TikTok's website.

I downloaded a JSON export of my TikTok data on 7/18/2021. Today (8/4/2021) I installed tiktok-save and ran .\save.py liked user_data.json liked_test The only thing in the liked_test folder is failures.json, which lists 7 items (corresponding to all 7 of my liked videos in my JSON export).

I don't know why all the videos are failing to download since, as of 8/4/2021 2:20am PST, 5 out of 7 of my liked videos are still viewable on TikTok and only the following 2 are unavailable: https://www.tiktok.com/@guywiththehair_official/video/6962207408601009414 https://www.tiktok.com/@caseyvanarsdale/video/6968513477006593285

See attached zips of my JSON export and tiktok-save failures: user_data.zip failures.zip

samirelanduk commented 3 years ago

Hmm - I just tried it on my machine using your data and it downloaded 5 successfully, with 2 failures, as it should be. Maybe we have different versions of some libraries. If you run pip freeze using the version of Python you are using, what do you get. I get:

beautifulsoup4==4.9.3
certifi==2021.5.30
chardet==4.0.0
greenlet==1.1.0
idna==2.10
playwright==1.12.1
pyee==8.1.0
requests==2.25.1
selenium==3.141.0
selenium-stealth==1.0.6
soupsieve==2.2.1
TikTokApi==3.9.9
tqdm==4.61.0
typing-extensions==3.10.0.0
urllib3==1.26.5
websockets==9.1

In particular, what version of TikTokApi does it show?

emCarCode commented 3 years ago

I am using Python 3.9.6. I just installed everything last night and have never used Python before (I only have a little bit of coding experience). Do I need to be signed into TikTok or copy a web_id or something similar from the site's cookies or anything like that? Here is what comes up after running pip freeze

certifi==2021.5.30
charset-normalizer==2.0.4
colorama==0.4.4
greenlet==1.1.0
idna==3.2
playwright==1.13.1
pyee==8.1.0
requests==2.26.0
selenium==3.141.0
selenium-stealth==1.0.6
TikTokApi==4.0.0
tqdm==4.62.0
urllib3==1.26.6
websockets==9.1
samirelanduk commented 3 years ago

I just bumped my TikTokApi version to 4.0.0 like yours, and then all 7 failed as yours did, so it looks like that's the cause. Try installing 3.9.9 (pip install TikTokApi==3.9.9) and see if that fixes it.

If it does I will update requirements.txt to mandate version 3.9.9, and look at what changed in the new version.

samirelanduk commented 3 years ago

(And no you don't need to sign in or anything like that.)

emCarCode commented 3 years ago

Installing TIkTokApi 3.9.9 fixed the issue, thanks!

samirelanduk commented 3 years ago

Great! Thanks for spotting this.