| 58 | |
| 59 | |
| 60 | def load_cookies() -> Tuple[str, str]: |
| 61 | cookie_cn, cookie_en = "", "" |
| 62 | env_file = "./.env" |
| 63 | if not os.path.exists(env_file): |
| 64 | return cookie_cn, cookie_en |
| 65 | with open(env_file, "r") as f: |
| 66 | lines = f.readlines() |
| 67 | for line in lines: |
| 68 | if line.startswith("COOKIE_CN"): |
| 69 | parts = line.split("=")[1:] |
| 70 | cookie_cn = "=".join(parts).strip().strip('"') |
| 71 | continue |
| 72 | |
| 73 | if line.startswith("COOKIE_EN"): |
| 74 | parts = line.split("=")[1:] |
| 75 | cookie_en = "=".join(parts).strip().strip('"') |
| 76 | continue |
| 77 | return cookie_cn, cookie_en |
| 78 | |
| 79 | |
| 80 | def load_refresh_config() -> bool: |