avilash / TikTokAPI-Python

TikTok API Python Wrapper
http://avilashkumar.com/TikTokAPI-Python/
MIT License
445 stars 114 forks source link

Cookie names not available #52

Open swordfish81 opened 2 years ago

swordfish81 commented 2 years ago

In the documentation it says to use the following:

cookie = {
  "s_v_web_id": "<your_key>",
  "tt_webid": "<your_key>"
}

But after logging in to Tiktok, there is no cookie by these names.

Seems like tt_webid has changed to ttwid. But cant figure out what or where to locate the s_v_web_id

Does anyone know?

swordfish81 commented 2 years ago

Even without login, the cookie names specified in the documentation dont exist. Cookie names are just these:

cmpl_token
msToken
bm_sv
sessionid_ss
sessionid
sid_tt
msToken
sid_ucp_v1
uid_tt_ss
odin_tt
_abck
ssid_ucp_v1
passport_csrf_token_default
passport_csrf_token
sid_guard
cookie-consent
uid_tt
bm_mi
csrf_session_id
ak_bmsc
ttwid
bm_sz
tt_csrf_token
swordfish81 commented 2 years ago

Just trying to get started with this and found that as per the documentation, those two cookie names do not exist. So even before im trying to do anything, the first step of the documentation seems a bit confusing.

Get your keys from Cookie. You can get them from the Applications tab in Chrome developer console.
By default it used hardcoded values which may not work after some time.
The keys to extract are s_v_web_id and tt_webid
swordfish81 commented 2 years ago

Ok, so my eventual goal is to use the: api.getLikesByUserName(user_name, count=3)

api = TikTokAPI(cookie=cookie)

and cookie essentially takes the s_v_web_id and tt_web_id

swordfish81 commented 2 years ago
from TikTokAPI import TikTokAPI as tta
cookie = {"s_v_web_id": '',"tt_webid": ''}
api = tta(cookie=cookie)
user_name = 'fcbarcelona'
api.getLikesByUserName(user_name, count=3)
Caraffa-git commented 2 years ago

same problem here I wan to use api.downloadVideoByIdNoWatermark()

Caraffa-git commented 2 years ago

It doesn't run tho, it just falls into a loop. Should it take so long?

api = TikTokAPI()
api.downloadVideoByIdNoWatermark(video_id = "6981810792173735194", save_path="./yes/")
balmacefa commented 2 years ago

if you take cookies from browser it changes to: s_v_web_id = s_v_web_id tt_webid => sid_ucp_v1

uqlel commented 2 years ago

cookie = { "s_v_web_id": "", "tt_webid": "" }

I have sid_ucp_v1 in my cookies, but i don't have s_v_web_id. How to fix it?