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

Cookies #24297

Closed
michealespinola opened this issue Mar 9, 2020 · 3 comments
Closed

Cookies #24297

michealespinola opened this issue Mar 9, 2020 · 3 comments
Labels

Comments

@michealespinola
Copy link

@michealespinola michealespinola commented Mar 9, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.03.08
  • I've checked that all provided URLs are alive and playable in a browser
  • 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

youtube-dl --update
[debug] System config: []
[debug] User config: ['--verbose', '--sub-lang', 'en,EN,eng,ENG,en-us,en-US,EN-US', '--write-sub', '--write-auto-sub', '--write-thumbnail', '--write-all-thumbnails', '--write-description', '--write-info-json', '--add-metadata', '--xattrs', '--external-downloader', 'aria2c', '--external-downloader-args', '-c -j 16 -s 16 -x 16 -k 5M --file-allocation=none', '--no-playlist', '--batch-file', 'C:\\Users\\X\\AppData\\Roaming\\youtube-dl\\download-queue.txt', '--netrc', '--cookies', 'C:\\Users\\X\\AppData\\Roaming\\youtube-dl\\cookies.txt', '--no-check-certificate', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', '--abort-on-unavailable-fragment', '--socket-timeout', '9', '--retries', '999', '--hls-prefer-native', '--ffmpeg-location', 'C:\\Program Files\\ffmpeg\\bin\\', '--merge-output-format', 'mkv', '--restrict-filenames', '--no-mtime', '--output', 'D:\\Downloads\\youtube-dl\\%(extractor)s\\%(title)s [%(resolution)s] [%(id)s].%(ext)s', '--download-archive', 'C:\\Users\\X\\AppData\\Roaming\\youtube-dl\\download-archive.txt']
[debug] Custom config: []
[debug] Command-line args: ['--update']
[debug] Batch file urls: []
C:\bin\youtube-dl.exe\http\cookiejar.py:2059: UserWarning: http.cookiejar bug!
Traceback (most recent call last):
  File "C:\Python\Python34\lib\http\cookiejar.py", line 2021, in _really_load
ValueError: too many values to unpack (expected 7)

Traceback (most recent call last):
  File "C:\Python\Python34\lib\http\cookiejar.py", line 2021, in _really_load
ValueError: too many values to unpack (expected 7)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "__main__.py", line 19, in <module>
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp378onz6j\build\youtube_dl\__init__.py", line 474, in main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp378onz6j\build\youtube_dl\__init__.py", line 441, in _real_main
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp378onz6j\build\youtube_dl\YoutubeDL.py", line 419, in __init__
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp378onz6j\build\youtube_dl\YoutubeDL.py", line 2329, in _setup_opener
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmp378onz6j\build\youtube_dl\utils.py", line 2762, in load
  File "C:\Python\Python34\lib\http\cookiejar.py", line 2061, in _really_load
http.cookiejar.LoadError: invalid Netscape format cookies file 'C:\\Users\\X\\AppData\\Roaming\\youtube-dl\\cookies.txt': 'www.smh.com.au\tFALSE\t/national\tFALSE\t1833029933770\t\tcookie\ttest'

Description

The latest version appears to have introduced an issue affecting cookies processing. Out of my 3000+ item cookies file, (8) items/lines caused an identical failure similar to what is pasted in the log above. As a test, I went through my cookies file and removed each offending line until it ran clean again. These were the offending lines (with confidential info redacted):

.ancestry.com	TRUE	/	FALSE	2212279769	VARS	LCID=1033&LCISONAME=enUS&COUNTRYCODE=US&WTT=REDACTED&UR=0&UREXP=2/8/2020 5:09:28 AM&MSFNF=DEFAULT&MSLNF=DEFAULT&SEARCHHC=20&NEWSFLAGS=5242880
.bedbathandbeyond.com	TRUE	/	FALSE	1613343612	last_internal_campaign	non internal campaign
.bedbathandbeyond.com	TRUE	/	FALSE	1613343612	last_finding_method	external campaign referral
.bedbathandbeyond.com	TRUE	/	FALSE	1613343612	last_cs_product	non-cross sell
.bedbathandbeyond.com	TRUE	/	FALSE	1613343612	last_cs_page	non-cross sell
.disqus.com	TRUE	/	TRUE	1590350129	disqusauths	"REDACTED REDACTED"
www.newsweek.com	FALSE	/	FALSE	1833029933770	X-UA-Info	country|US|state|CA|city|Los Angeles|latitude|REDACTED|longitude|-REDACTED|isp|REDACTED|ip|REDACTED|device|desktop|time|1582755754
www.smh.com.au	FALSE	/national	FALSE	1833029933770		cookie test
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 9, 2020

Malformed cookie file. Cookie value is not allowed to contain spaces.

@dstftw dstftw closed this Mar 9, 2020
@dstftw dstftw added the invalid label Mar 9, 2020
@kruug
Copy link

@kruug kruug commented Mar 9, 2020

Cookie file worked with the previous version of Youtube-DL. The new version doesn't accept the cookie file.

If the file isn't supposed to include spaces, why does the recommended tool allow/inject spaces?

@kruug
Copy link

@kruug kruug commented Mar 9, 2020

Current RFC 6265 clearly disallows spaces inside cookie values. BUT the current RFC says to ignore bad cookie values, not break the software when an error is encountered.

This is CS101 error-handling.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.