@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
python3 - << 'PYEOF'
|
||||
import time, json, os
|
||||
from selenium import webdriver
|
||||
from selenium.webdriver.firefox.options import Options
|
||||
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
|
||||
import glob
|
||||
|
||||
profile_dir = os.path.expanduser("~/Library/Application Support/Firefox/Profiles")
|
||||
profiles = glob.glob(f"{profile_dir}/*.default-release") + glob.glob(f"{profile_dir}/*.default")
|
||||
profile = FirefoxProfile(profiles[0])
|
||||
options = Options()
|
||||
options.profile = profile
|
||||
|
||||
driver = webdriver.Firefox(options=options)
|
||||
try:
|
||||
driver.get("https://watch.lifetimemovieclub.com")
|
||||
print("Log into Lifetime Movie Club in the Firefox window.")
|
||||
print("(Also be logged into History Vault, Crime Central, play.history.com, play.mylifetime.com and discoveryplus.com in Firefox.)")
|
||||
print("Once logged in, come back here and press Enter...")
|
||||
input()
|
||||
|
||||
cookies = driver.get_cookies()
|
||||
|
||||
print("Grabbing History Vault cookies...")
|
||||
driver.get("https://watch.historyvault.com")
|
||||
time.sleep(4)
|
||||
cookies.extend(driver.get_cookies())
|
||||
|
||||
print("Grabbing A&E Crime Central cookies...")
|
||||
driver.get("https://watch.aecrimecentral.com")
|
||||
time.sleep(4)
|
||||
cookies.extend(driver.get_cookies())
|
||||
|
||||
print("Grabbing History (play.history.com) cookies...")
|
||||
driver.get("https://play.history.com")
|
||||
time.sleep(4)
|
||||
cookies.extend(driver.get_cookies())
|
||||
|
||||
print("Grabbing Lifetime (play.mylifetime.com) cookies...")
|
||||
driver.get("https://play.mylifetime.com")
|
||||
time.sleep(4)
|
||||
cookies.extend(driver.get_cookies())
|
||||
|
||||
print("Grabbing Discovery+ cookies...")
|
||||
driver.get("https://www.discoveryplus.com")
|
||||
time.sleep(4)
|
||||
cookies.extend(driver.get_cookies())
|
||||
|
||||
cookie_file = os.path.expanduser("~/.aetn_cookies.json")
|
||||
with open(cookie_file, 'w') as f:
|
||||
json.dump(cookies, f, indent=2)
|
||||
print(f"✅ Saved {len(cookies)} cookies to {cookie_file}")
|
||||
finally:
|
||||
driver.quit()
|
||||
PYEOF
|
||||
Reference in New Issue
Block a user