зеркало из
https://github.com/viginum-datalab/twscrape.git
synced 2025-10-29 05:04:22 +02:00
fix login when no ct0 found #143
Этот коммит содержится в:
родитель
728ff6ab69
Коммит
e921e9e408
@ -242,11 +242,11 @@ async def login(acc: Account, cfg: LoginConfig | None = None) -> Account:
|
|||||||
rep = await login_initiate(client)
|
rep = await login_initiate(client)
|
||||||
ctx = TaskCtx(client, acc, cfg, None, imap)
|
ctx = TaskCtx(client, acc, cfg, None, imap)
|
||||||
while True:
|
while True:
|
||||||
|
rep = await next_login_task(ctx, rep)
|
||||||
if not rep:
|
if not rep:
|
||||||
break
|
break
|
||||||
|
|
||||||
rep = await next_login_task(ctx, rep)
|
assert "ct0" in client.cookies, "ct0 not in cookies (most likely ip ban)"
|
||||||
|
|
||||||
client.headers["x-csrf-token"] = client.cookies["ct0"]
|
client.headers["x-csrf-token"] = client.cookies["ct0"]
|
||||||
client.headers["x-twitter-auth-type"] = "OAuth2Session"
|
client.headers["x-twitter-auth-type"] = "OAuth2Session"
|
||||||
|
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user