fix safari cookie path resolution

This commit is contained in:
Bortlesboat
2026-05-05 13:42:59 -04:00
committed by Trevin Chow
parent 16a4fa9c39
commit 0656b868e7
2 changed files with 65 additions and 15 deletions
@@ -107,7 +107,18 @@ def extract_safari_cookies_macos(
if sys.platform != "darwin":
return None
cookie_path = Path.home() / "Library" / "Cookies" / "Cookies.binarycookies"
cookie_paths = [
Path.home()
/ "Library"
/ "Containers"
/ "com.apple.Safari"
/ "Data"
/ "Library"
/ "Cookies"
/ "Cookies.binarycookies",
Path.home() / "Library" / "Cookies" / "Cookies.binarycookies",
]
cookie_path = next((path for path in cookie_paths if path.exists()), cookie_paths[0])
try:
raw = cookie_path.read_bytes()