Compare commits

..

3 Commits

Author SHA1 Message Date
sepro
601ca34151 Merge branch 'fix/kesor/chrome-cookies-hack' of https://github.com/kesor/yt-dlp into pr/11425 2024-11-02 22:57:06 +01:00
sepro
d334ddc6d0 Also for linux v10 cookies 2024-11-02 22:56:38 +01:00
sepro
ed98f01b12
Update yt_dlp/cookies.py 2024-11-02 22:42:57 +01:00

View File

@ -308,7 +308,7 @@ def _extract_chrome_cookies(browser_name, profile, keyring, logger):
cursor = _open_database_copy(cookie_database_path, tmpdir) cursor = _open_database_copy(cookie_database_path, tmpdir)
# meta_version is necessary to determine if we need to trim the hash prefix from the cookies # meta_version is necessary to determine if we need to trim the hash prefix from the cookies
# Ref: https://github.com/yt-dlp/yt-dlp/issues/6564#issuecomment-2428437307 # Ref: https://chromium.googlesource.com/chromium/src/+/b02dcebd7cafab92770734dc2bc317bd07f1d891/net/extras/sqlite/sqlite_persistent_cookie_store.cc#223
meta_version = int(cursor.execute('SELECT value FROM meta WHERE key = "version"').fetchone()[0]) meta_version = int(cursor.execute('SELECT value FROM meta WHERE key = "version"').fetchone()[0])
decryptor = get_cookie_decryptor( decryptor = get_cookie_decryptor(
config['browser_dir'], config['keyring_name'], logger, config['browser_dir'], config['keyring_name'], logger,
@ -456,7 +456,9 @@ class LinuxChromeCookieDecryptor(ChromeCookieDecryptor):
if version == b'v10': if version == b'v10':
self._cookie_counts['v10'] += 1 self._cookie_counts['v10'] += 1
return _decrypt_aes_cbc_multi(ciphertext, (self._v10_key, self._empty_key), self._logger) return _decrypt_aes_cbc_multi(
ciphertext, (self._v10_key, self._empty_key), self._logger,
hash_prefix=self._meta_version >= 24)
elif version == b'v11': elif version == b'v11':
self._cookie_counts['v11'] += 1 self._cookie_counts['v11'] += 1