1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 07:30:37 +01:00

update github acction

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-07-30 05:55:44 +09:00
parent 86315f25a0
commit 0b34065deb
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
7 changed files with 114 additions and 26 deletions

View file

@ -1,7 +1,8 @@
import json
import os
import logging
import python_generated as pt
import base64
import openapi_client as pt
from pathlib import Path
@ -12,7 +13,8 @@ if Path("cookie.json").exists():
with open("cookie.json", "r") as f:
cookies = json.load(f)
else:
cookies = json.loads(os.environ["TWITTER_SESSION"])
data = base64.b64decode(os.environ["TWITTER_SESSION"]).decode("utf-8")
cookies = json.loads(data)
cookies_str = "; ".join([f"{k}={v}" for k, v in cookies.items()])
@ -65,6 +67,9 @@ for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UserListApi]:
except Exception as e:
logger.error(f"{key}")
logger.error(e)
import traceback
logger.error(traceback.print_exc())
error_count += 1
if error_count > 0: