yt-dlp: The --cookies-from-browser command results in `WARNING: failed to decrypt cookie because UTF-8 decoding failed. Possibly the key is wrong?`

Checklist

  • I’m reporting a bug unrelated to a specific site
  • I’ve verified that I’m running yt-dlp version 2021.09.02
  • I’ve checked that all provided URLs are alive and playable in a browser
  • The provided URLs do not contain any DRM to the best of my knowledge
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar bug reports including closed ones
  • I’ve read bugs section in FAQ

Verbose log

Side Note: The WARNING: failed to decrypt cookie because UTF-8 decoding failed. Possibly the key is wrong? message pops up SEVERAL times. I only put the first two lines with that message and put […] in place of all the other ones.

Admins-MacBook-Pro:~ Victoria$ yt-dlp --print "%(playlist_index)s %(original_url)s %(title)s - %(uploader)s [%(duration_string)s]" --flat-playlist "https://www.youtube.com/playlist?list=WL" --cookies-from-browser chrome:Default --verbose
[debug] Command-line config: ['--print', '%(playlist_index)s %(original_url)s %(title)s - %(uploader)s [%(duration_string)s]', '--flat-playlist', 'https://www.youtube.com/playlist?list=WL', '--cookies-from-browser', 'chrome:Default', '--verbose']
[Cookies] Extracting cookies from chrome
[debug] extracting from: "/Users/Victoria/Library/Application Support/Google/Chrome/Default/Cookies"
WARNING: failed to decrypt cookie because UTF-8 decoding failed. Possibly the key is wrong?
WARNING: failed to decrypt cookie because UTF-8 decoding failed. Possibly the key is wrong?
[...]
[Cookies] Extracted 4753 cookies from chrome (1261 could not be decrypted)
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] yt-dlp version 2021.09.02 
[debug] Python version 3.9.6 (CPython 64bit) - macOS-10.14.6-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.4, ffprobe 4.4
[debug] Optional libraries: mutagen, pycryptodome, sqlite, websockets
[debug] Proxy map: {}
[debug] [youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=WL
[youtube:tab] WL: Downloading webpage
ERROR: [youtube:tab] WL: YouTube said: The playlist does not exist.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 584, in extract
    ie_result = self._real_extract(url)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4187, in _real_extract
    info_dict = self.__real_extract(url, smuggled_data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4255, in __real_extract
    webpage, data = self._extract_webpage(url, item_id)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4171, in _extract_webpage
    self._extract_and_report_alerts(data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 738, in _extract_and_report_alerts
    return self._report_alerts(self._extract_alerts(data), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 735, in _report_alerts
    raise ExtractorError('YouTube said: %s' % errors[-1][1], expected=expected)
yt_dlp.utils.ExtractorError: YouTube said: The playlist does not exist.
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 584, in extract
    ie_result = self._real_extract(url)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4187, in _real_extract
    info_dict = self.__real_extract(url, smuggled_data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4255, in __real_extract
    webpage, data = self._extract_webpage(url, item_id)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4171, in _extract_webpage
    self._extract_and_report_alerts(data)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 738, in _extract_and_report_alerts
    return self._report_alerts(self._extract_alerts(data), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 735, in _report_alerts
    raise ExtractorError('YouTube said: %s' % errors[-1][1], expected=expected)
yt_dlp.utils.ExtractorError: YouTube said: The playlist does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1214, in wrapper
    return func(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py", line 1239, in __extract_info
    ie_result = ie.extract(url)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 600, in extract
    raise ExtractorError(
yt_dlp.utils.ExtractorError: [youtube:tab] WL: YouTube said: The playlist does not exist.

Description

I’m using yt-dlp on my Mac this time around. I wanted to try out the new --cookies-from-browser command, but I kept getting that error for both my Watch Later playlist and another privated playlist. Yt-dlp has been downloaded through Python 3.9.6. I have pip 21.2.4.

$ pip --version
pip 21.2.4 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

I’ve checked if Default is the name of my profile. Looking at the folder, I see the profile picture I use for it, so I must’ve gotten the right path, at least.

I know I could just extract my cookies, but like I said, I wanted to see how the new command would work. Besides, I thought it might be good to at least report this issue.

Thanks in advance!

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I set up another MacOS VM and I was able to reproduce this issue with a completely fresh installation and the error still occurs with the original release. The fix seems quite simple (I was worried that chrome changed something about it’s cookie storage). It looks like when using the find-generic-password method of obtaining the password I forgot to strip the newline from the returned data. When I was testing before I probably had keyring installed so it used that. I will post a pull request soon