Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions myUtils/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ async def on_url_change():
return None
uuid_v1 = uuid.uuid1()
print(f"UUID v1: {uuid_v1}")
await context.storage_state(path=Path(BASE_DIR / "cookiesFile" / f"{uuid_v1}.json"))
# 确保cookiesFile目录存在
cookies_dir = Path(BASE_DIR / "cookiesFile")
cookies_dir.mkdir(exist_ok=True)
await context.storage_state(path=cookies_dir / f"{uuid_v1}.json")
result = await check_cookie(3, f"{uuid_v1}.json")
if not result:
status_queue.put("500")
Expand Down Expand Up @@ -125,7 +128,10 @@ async def on_url_change():
return None
uuid_v1 = uuid.uuid1()
print(f"UUID v1: {uuid_v1}")
await context.storage_state(path=Path(BASE_DIR / "cookiesFile" / f"{uuid_v1}.json"))
# 确保cookiesFile目录存在
cookies_dir = Path(BASE_DIR / "cookiesFile")
cookies_dir.mkdir(exist_ok=True)
await context.storage_state(path=cookies_dir / f"{uuid_v1}.json")
result = await check_cookie(2,f"{uuid_v1}.json")
if not result:
status_queue.put("500")
Expand Down Expand Up @@ -196,7 +202,10 @@ async def on_url_change():
return None
uuid_v1 = uuid.uuid1()
print(f"UUID v1: {uuid_v1}")
await context.storage_state(path=Path(BASE_DIR / "cookiesFile" / f"{uuid_v1}.json"))
# 确保cookiesFile目录存在
cookies_dir = Path(BASE_DIR / "cookiesFile")
cookies_dir.mkdir(exist_ok=True)
await context.storage_state(path=cookies_dir / f"{uuid_v1}.json")
result = await check_cookie(4, f"{uuid_v1}.json")
if not result:
status_queue.put("500")
Expand Down Expand Up @@ -267,7 +276,10 @@ async def on_url_change():
return None
uuid_v1 = uuid.uuid1()
print(f"UUID v1: {uuid_v1}")
await context.storage_state(path=Path(BASE_DIR / "cookiesFile" / f"{uuid_v1}.json"))
# 确保cookiesFile目录存在
cookies_dir = Path(BASE_DIR / "cookiesFile")
cookies_dir.mkdir(exist_ok=True)
await context.storage_state(path=cookies_dir / f"{uuid_v1}.json")
result = await check_cookie(1, f"{uuid_v1}.json")
if not result:
status_queue.put("500")
Expand Down