avoid unneeded cookie open

This commit is contained in:
simon 2022-05-07 09:34:33 +07:00
parent 3ca86ba91d
commit 087043811f
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@ class CookieHandler:
print("no cookie imported")
raise FileNotFoundError
if os.path.exists(self.COOKIE_PATH):
return self.COOKIE_PATH
with open(self.COOKIE_PATH, "w", encoding="utf-8") as cookie_file:
cookie_file.write(cookie)