TikTokAPI-Python icon indicating copy to clipboard operation
TikTokAPI-Python copied to clipboard

Cookie names not available

Open swordfish81 opened this issue 3 years ago • 8 comments

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 avatar Jan 01 '22 05:01 swordfish81

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 avatar Jan 01 '22 05:01 swordfish81

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 avatar Jan 01 '22 05:01 swordfish81

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 avatar Jan 01 '22 06:01 swordfish81

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)

swordfish81 avatar Jan 01 '22 06:01 swordfish81

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

Caraffa-git avatar Jan 07 '22 15:01 Caraffa-git

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/")

Caraffa-git avatar Jan 07 '22 16:01 Caraffa-git

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

balmacefa avatar Jan 09 '22 21:01 balmacefa

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

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

uqlel avatar Jan 30 '22 10:01 uqlel