Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
--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. |
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