dfreelon / pyktok

A simple module to collect video, text, and metadata from Tiktok.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request error with slides download

Lexsah opened this issue · comments

Hello,
I updated to the last version (.19) to patch #35.
Video works fine now but slides don't.

I have the following error: Invalid URL '': No schema supplied. Perhaps you meant http://?
Am I the only one having this issue ?

Thanks in advance.

@BillyBSig implemented this part of the code so I'll need to take some time to test it. But that "No schema supplied" error may occur if you omit the "https://" part of the TT URL (e.g. if you use "tiktok.com/@whateveretc..." instead of "https://tiktok.com/@whateveretc..."

I'm using a similar parsing on both video and slides, I want to note that I had no issues with this previously.
Here is a snippet of my code with the linked output for both a video and a slide :

try:
    print(f"Trying to save {i}")
    pyk.save_tiktok(i,True)
    print("Save successful")
except Exception as e:
    print(f"Tiktok save error: {e}")

Output:

Trying to save https://vm.tiktok.com/ZGJoHUT3e/
Tiktok save error: Invalid URL '': No scheme supplied. Perhaps you meant https://?
Trying to save https://vm.tiktok.com/ZGed6wJx2/
Saved video
 https://v16-webapp-prime.tiktok.com/video/tos/maliva/tos-maliva-ve-0068c799-us/oUCIAEmgjgvQKA6ff1gvqeC9sW [...]

The issue isn't from the https as it is given in the command input

OK figured out the problem--the address used for video downloading is blank for slideshows. It'll take me some time to fix it, but if you want to access the data yourself in the meantime, you can find it in the output of alt_get_tiktok_json at tt_json["__DEFAULT_SCOPE__"]['webapp.video-detail']['itemInfo']['itemStruct']['imagePost']