0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-22 02:15:12 +00:00

[cookies] Update MacOS12 Cookies.binarycookies location (#2742)

Authored by: mdpauley
This commit is contained in:
Michael Pauley 2022-02-14 09:36:51 -05:00 committed by GitHub
parent e8969bda94
commit 1f7db8533a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -454,7 +454,10 @@ def _extract_safari_cookies(profile, logger):
cookies_path = os.path.expanduser('~/Library/Cookies/Cookies.binarycookies')
if not os.path.isfile(cookies_path):
raise FileNotFoundError('could not find safari cookies database')
logger.debug('Trying secondary cookie location')
cookies_path = os.path.expanduser('~/Library/Containers/com.apple.Safari/Data/Library/Cookies/Cookies.binarycookies')
if not os.path.isfile(cookies_path):
raise FileNotFoundError('could not find safari cookies database')
with open(cookies_path, 'rb') as f:
cookies_data = f.read()