-
Notifications
You must be signed in to change notification settings - Fork 10k
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
--cookies: be more flexible in the file format #4539
Comments
You have to use tabs instead of spaces in the cookie file. |
Reopening - we should support tabs as well. |
Apparently you also need to add |
How to use youtube-dl with cookies to download videos from a sessionFor other's who end up here looking for some docs on how to use youtube-dl and examples of a cookies.txt file. Valid Cookie FileYour Cookies.txt
Remember TABS ONLY (Some editors may convert tabs to spaces on save so make sure to check this if you're still getting this error!) UsageYou can use it like so (Jazzed up in a bash script for multiple items):
Further Details for each cookie value
Invalid Cookie file errorExample of an error with invalid
youtube-dl cookies example, youtube-dl auth, youtube-dl session, youtube-dl PHPSESSID, invalid netscape cookie file |
I keep getting an assertion error when a cookie has a
like
|
I've worked around the assert error using the solution found here to regenerate the cookie file with curl |
I had to remove decimal portions of timestamps from the |
I had to remove the leading dot in the domain names for the file to be accepted by youtube-dl. |
If I do that I get a lot of: |
The first boolean must always be |
i want to know how to save cookie.think you |
you can google a chrome extension that copies cookies there are many in chrome's marketplace |
See FAQ
No, follow the FAQ answer. |
This comment above and the FAQ answer resolve the issue. Cookie file parsing in yt-dl is down to Python: if it doesn't work, that's a problem for Python or (for unsupported versions) for yt-dlp has a cookie handler that supports some bad cookie formats found in the wild, which may get back-ported. |
youtube-dl -e "https://www.youtube.com/watch?v=5GTXaObrXr0" --print-traffic --cookie my_cookies.txt
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/bin/youtube-dl/main.py", line 19, in
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 361, in main
File "/usr/local/bin/youtube-dl/youtube_dl/init.py", line 330, in _real_main
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 280, in init
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1439, in _setup_opener
File "/usr/lib/python2.7/cookielib.py", line 1763, in load
self._really_load(f, filename, ignore_discard, ignore_expires)
File "/usr/lib/python2.7/_MozillaCookieJar.py", line 55, in _really_load
filename)
cookielib.LoadError: 'my_cookies.txt' does not look like a Netscape format cookies file
my_cookies.txt source:
.youtube.com TRUE / FALSE 1440244957 PREF f1=50000000
.youtube.com TRUE / FALSE 1482278977 gojf ddd4fbef2abea5cf5ded8493c2ed5f07cwsAAABFUGRhSDcyaEw0RQ==
.youtube.com TRUE / FALSE 1440244956 VISITOR_INFO1_LIVE euPxAjtmFn0
The text was updated successfully, but these errors were encountered: