MCPcopy
hub / github.com/doocs/leetcode / load_cookies

Function load_cookies

solution/util.py:60–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59
60def 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
80def load_refresh_config() -> bool:

Callers 1

runFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected