mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
17 lines
391 B
Python
17 lines
391 B
Python
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)
|