diff --git a/main.py b/main.py index 3653347..a49cdf4 100644 --- a/main.py +++ b/main.py @@ -132,10 +132,6 @@ def flush_files(): def init_session(): - cookies = http.cookies.SimpleCookie() - cookies["SESSDATA"] = SESSDATA - cookies["SESSDATA"]["domain"] = "bilibili.com" - global session session = aiohttp.ClientSession() session.cookie_jar.update_cookies(cookies) @@ -171,7 +167,8 @@ clients = {} log_files = {} with open("cookie.txt", "r", encoding="utf-8") as f: - SESSDATA = f.read().strip() + cookies = http.cookies.SimpleCookie() + cookies.load(f.read().strip()) session: Optional[aiohttp.ClientSession] = None