tiktok-dl icon indicating copy to clipboard operation
tiktok-dl copied to clipboard

Implement device registration

Open davispuh opened this issue 4 years ago • 12 comments

That would make it a lot easier. I haven't looked into it, but there should be some API with which you can register your device and get iid automatically. Like in app you can use username/password.

davispuh avatar Apr 11 '20 23:04 davispuh

I would, if I had the time to do so. Unfortunately I don't. Everyone is welcome to contribute to this project.

dvingerh avatar Apr 12 '20 00:04 dvingerh

hello, i have tried your script, but it is not working, i got my device id and my iid, but it still not working

kamronbek29 avatar May 11 '20 17:05 kamronbek29

I think it's not working now as there's this extra content headers "x-gorgon x-khronos" which are dynamically generated . I think Tik Tok has updated their security .

Fyp89 avatar May 12 '20 02:05 Fyp89

@dvingerh I'd like to have your thoughts on it .

Fyp89 avatar May 12 '20 02:05 Fyp89

Tiktok's api is really finicky, sometimes the script will work sometimes it wont. This script used to work pretty well without much issues but it has recently started to have trouble grabbing the info yeah.

But i did just test it with my iid and device id and while it struggled to get a proper response eventually after a few retries it did get the user info and video information to download. So i wouldn't say it's a completely dead script but there are definitely better solutions floating around github which I would suggest to use instead

dvingerh avatar May 12 '20 09:05 dvingerh

@dvingerh Thank you so much for taking out the time to reply .

Would it be too much to ask If I could know what changes you did to get the results . It may help me as well . Yes there are other solutions as well , but this one perfectly suits my needs .

When I run the script to get the user by username , the user_list array in the json response is empty and it's always empty , no matter what i search it with . So after researching it a bit on different forums , I thought it is because of the extra anti spam parameters Tiktok api has added namely x-gorgon x-khronos .

But as you said , you got it working , so that means it has nothing to do with the anti spam parameters . I'd like to know how you got it working . Thanks .

Fyp89 avatar May 12 '20 15:05 Fyp89

I'd like to know how you got it working

I have only entered my device id and iid. No other steps were taken and no changes were made to code

But more often than not it doesn't work and i get one of the two results:

  • JSON response is received but only has {"status_code":0,"status_msg":"","block_code":2018}
  • No JSON is returned whatsoever (empty response)

I'm going to assume this is because not all required parameters and such are being sent which results in the tiktok servers rejecting the request in some way but why it doesn't reject every single request remains elusive to me.

dvingerh avatar May 12 '20 15:05 dvingerh

yes, u r correct.I have tried to scrap my phone by chareless, and saw all the tiktok request to their servers and understood one thing. This is because of the headers XGorgon and XXronos. I have tried to make request to a specific video without xgorgon, i got empty response, but when i added headers XGorgon and XXronos the script worked. So i think the problem is this. I've tried to find, how they are generating it, because each video has a unique xgorgon, so u cant use XGorgon of one video with another video.

kamronbek29 avatar May 12 '20 16:05 kamronbek29

@kamronbek29 Please let us know , if you find something .

Fyp89 avatar May 12 '20 19:05 Fyp89

I can generate x-gorgon,works for video list,but got empty response with user info

tmxd09887 avatar May 23 '20 07:05 tmxd09887

@tmxd09887 hello. Could u share With us the script to generate xgorgon, please?

kamronbek29 avatar May 23 '20 10:05 kamronbek29

For anyone still interested check out this repository

Venack avatar Jan 06 '21 13:01 Venack