Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netscape format not working with youtube-dl #96

Open
alitajelsir opened this issue Jul 1, 2020 · 4 comments · May be fixed by #139
Open

Netscape format not working with youtube-dl #96

alitajelsir opened this issue Jul 1, 2020 · 4 comments · May be fixed by #139

Comments

@alitajelsir
Copy link

  • I get the following error http.cookiejar.LoadError: 'Downloads/cookies.txt' does not look like a Netscape format cookies file when using the cookies file downloaded in a Netscape format. This is working fine with extensions like cookies.text and Export Cookies.
  • Running the latest version in Firefox 77
  • I don't know if it would be beneficial, but this is the error output from youtube-dl:
Traceback (most recent call last):
  File "/usr/bin/youtube-dl", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/youtube_dl/__init__.py", line 474, in main
    _real_main(argv)
  File "/usr/lib/python3.8/site-packages/youtube_dl/__init__.py", line 441, in _real_main
    with YoutubeDL(ydl_opts) as ydl:
  File "/usr/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 419, in __init__
    self._setup_opener()
  File "/usr/lib/python3.8/site-packages/youtube_dl/YoutubeDL.py", line 2329, in _setup_opener
    self.cookiejar.load(ignore_discard=True, ignore_expires=True)
  File "/usr/lib/python3.8/site-packages/youtube_dl/utils.py", line 2840, in load
    self._really_load(cf, filename, ignore_discard, ignore_expires)
  File "/usr/lib/python3.8/http/cookiejar.py", line 2020, in _really_load
    raise LoadError(
http.cookiejar.LoadError: 'Downloads/cookies.txt' does not look like a Netscape format cookies file
@TpmKranz
Copy link

I suspect it has something to do with this:
https://stackoverflow.com/a/11536599

At least for me, the header is missing in exported files and that's what caused problems with youtube-dl.

@fmorato
Copy link

fmorato commented Jul 29, 2020

Just had the same issue and came here to report. Indeed, the info in that SO question did the trick.

The file exported by the extension is missing the first line, which should be either

# HTTP Cookie File

or

# Netscape HTTP Cookie File

Adding that as the first line of the file makes it work with youtube-dl.

@TFWol
Copy link

TFWol commented Jan 18, 2022

I wish this add-on had the option to insert that comment line since most of the programs that use this format look for that header...

Another thing that causes issues are the www lines that have a leading '.'
ex: .www.somesite.com

@dspeyrer dspeyrer linked a pull request Apr 20, 2022 that will close this issue
@Explorare
Copy link

youtube-dl only accepts tabs rather than spaces. This will also cause the issue.
ref: --cookies: be more flexible in the file format · Issue #4539 · ytdl-org/youtube-dl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants