1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 15:40:26 +01:00

update login.py

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-07-30 18:02:56 +09:00
parent 72ce819505
commit b37c178f1c
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA

17
tools/login.py Normal file
View file

@ -0,0 +1,17 @@
import json
import base64
from tweepy_authlib import CookieSessionUserHandler
auth_handler = CookieSessionUserHandler(
screen_name=input("screen_name: "),
password=input("password: "),
)
cookies = auth_handler.get_cookies()
data = json.dumps(cookies.get_dict())
print(base64.b64encode(data.encode("utf-8")).decode("utf-8"))
with open("cookie.json", "w") as f:
f.write(data)