Skip to content

Commit

Permalink
[cookies] Improve error message for Windows `--cookies-from-browser c…
Browse files Browse the repository at this point in the history
…hrome` issue (#9080)

Authored by: Grub4K
  • Loading branch information
Grub4K committed Jan 31, 2024
1 parent cbed249 commit 2792092
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion yt_dlp/cookies.py
Expand Up @@ -24,14 +24,16 @@
aes_gcm_decrypt_and_verify_bytes,
unpad_pkcs7,
)
from .compat import functools
from .compat import functools # isort: split
from .compat import compat_os_name
from .dependencies import (
_SECRETSTORAGE_UNAVAILABLE_REASON,
secretstorage,
sqlite3,
)
from .minicurses import MultilinePrinter, QuietMultilinePrinter
from .utils import (
DownloadError,
Popen,
error_to_str,
expand_path,
Expand Down Expand Up @@ -318,6 +320,12 @@ def _extract_chrome_cookies(browser_name, profile, keyring, logger):
counts['unencrypted'] = unencrypted_cookies
logger.debug(f'cookie version breakdown: {counts}')
return jar
except PermissionError as error:
if compat_os_name == 'nt' and error.errno == 13:
message = 'Could not copy Chrome cookie database. See https://github.com/yt-dlp/yt-dlp/issues/7271 for more info'
logger.error(message)
raise DownloadError(message) # force exit
raise
finally:
if cursor is not None:
cursor.connection.close()
Expand Down

0 comments on commit 2792092

Please sign in to comment.