File size: 704 Bytes
303ebf1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# login.py
import undetected_chromedriver as uc
import json
import time
TARGET_URL = "https://hailuoai.video/create"
COOKIES_FILE = "cookies.json"
def main():
# Khởi Chrome (có cửa sổ để bạn login thủ công)
driver = uc.Chrome()
driver.get(TARGET_URL)
print("👉 Vui lòng login vào hailuoai.video trong cửa sổ này.")
input("⏳ Sau khi login xong, nhấn Enter ở đây để lưu cookies…")
cookies = driver.get_cookies()
with open(COOKIES_FILE, 'w', encoding='utf-8') as f:
json.dump(cookies, f, ensure_ascii=False, indent=2)
print(f"✅ Đã lưu cookies vào {COOKIES_FILE}")
driver.quit()
if __name__ == "__main__":
main()
|