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

use cookies to download error #9251

Closed
Token713 opened this issue Apr 20, 2016 · 14 comments
Closed

use cookies to download error #9251

Token713 opened this issue Apr 20, 2016 · 14 comments

Comments

@Token713
Copy link

@Token713 Token713 commented Apr 20, 2016

D:\Program Files\youtube-dl>youtube-dl.exe --cookies D:\Program Files\youtube-dl
\cookies.txt http://v.youku.com/v_show/id_XMTUzNzM1MjUwMA==.html
ERROR: u'Files\\youtube-dl\\cookies.txt' is not a valid URL. Set --default-searc
h "ytsearch" (or run  youtube-dl "ytsearch:Files\youtube-dl\cookies.txt" ) to se
arch YouTube
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 20, 2016

Put path to cookie file in quotes.

@dstftw dstftw closed this Apr 20, 2016
@Token713
Copy link
Author

@Token713 Token713 commented Apr 20, 2016

now ,the new error:
`D:\Program Files\youtube-dl>youtube-dl.exe --cookies "D:\Program Files\youtube-d
l\cookies.txt" http://v.youku.com/v_show/id_XMTUzNzM1MjUwMA==.html
D:\Program Files\youtube-dl\youtube-dl.exe_MozillaCookieJar.py:109: UserWarning
: cookielib bug!
Traceback (most recent call last):
File "_MozillaCookieJar.pyo", line 71, in _really_load
ValueError: need more than 6 values to unpack

Traceback (most recent call last):
File "main.py", line 19, in
File "youtube_dl__init__.pyo", line 419, in main
File "youtube_dl__init__.pyo", line 386, in _real_main
File "youtube_dl\YoutubeDL.pyo", line 346, in init
File "youtube_dl\YoutubeDL.pyo", line 2022, in _setup_opener
File "cookielib.pyo", line 1779, in load
File "_MozillaCookieJar.pyo", line 111, in _really_load
cookielib.LoadError: invalid Netscape format cookies file u'D:\Program Files\y
outube-dl\cookies.txt': '.svip.youku.com\tTRUE\t/\tFALSE\tHm_lpvt_019e9f304abf1
a21f6c70322d9ce71d6\t1461165915'`

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 20, 2016

Malformed cookie file.

@Token713
Copy link
Author

@Token713 Token713 commented Apr 20, 2016

how to output the right format of cookies.txt?Is there a tools to output cookies,i used the Mozilla Firefox and it has no tools to out put cookies.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 20, 2016

There numerous cookie exporting add-ons for Firefox available.

@Token713
Copy link
Author

@Token713 Token713 commented Apr 20, 2016

i used the firebug,and it output the format like this:
.youku.com TRUE / FALSE P_F 1 .youku.com TRUE / FALSE P_T 1461174671 .youku.com TRUE / FALSE 1462375496 __ali 1461165895580G8D .youku.com TRUE / FALSE 1462375516 __aliCount 1 .youku.com TRUE / FALSE 1492703352 __hpage_style 0 .youku.com TRUE / FALSE __utmarea .youku.com TRUE / FALSE 2091885896 __ysuid 14611658955808QO .youku.com TRUE / FALSE _l_lgi 59474875 www.youku.com FALSE / FALSE 1461253756 _youku_ad_crazy_taobao_count 1 .youku.com TRUE / FALSE 1463759354 advideo {"adv205916_3": 2, "adv205987_3": 4} .youku.com TRUE / FALSE advideo206013_2 1 .youku.com TRUE / FALSE advideo206025_2 2 .youku.com TRUE / FALSE 1776525894 cna on6eD6EfvEgCAXuLMHF6LBSA .v.youku.com TRUE / FALSE 1466349479 player_pos 949.5|50 .youku.com TRUE / FALSE premium_cps 2072719473_2%7C471%7C83763%7C4201___ .youku.com TRUE / FALSE premium_cps_vid XMTUzNzM1MjUwMA%3D%3D .youku.com TRUE / FALSE rpabtest A-1461167430383 .youku.com TRUE / FALSE rpvid 1461167442546CPHbW6-1461167471312 .youku.com TRUE / FALSE u LX%E3%80%812199 .youku.com TRUE / FALSE xreferrer http://static.youku.com/paymentcenter/svip/build/svipIndex.html .youku.com TRUE / FALSE ykss faa41757b392ce3a6f6a177b .youku.com TRUE / FALSE 1492703353 yktk 1%7C1461165922%7C15%7CaWQ6NTk0NzQ4NzUsbm46TFjjgIEyMTk5LHZpcDp0cnVlLHl0aWQ6NTM3MzUxOTkwLHRpZDow%7C49ba55618d2ff20d06897c718fad70a2%7C0188ccc0a023cf9e6a45b55a505778e2d09f8280%7C1%7C1%7C1%7C1

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Apr 20, 2016

@Token713
Copy link
Author

@Token713 Token713 commented Apr 20, 2016

Firebug is a script for Firefox,http://getfirebug.com/

@Token713
Copy link
Author

@Token713 Token713 commented Apr 20, 2016

Is there anyother scripts for Firefox?

@Forket
Copy link

@Forket Forket commented May 3, 2016

True is that i've also exported cookies using plugin. And even seems that your script recognizes it's netscape format. But it throws error for some exact cookie string (mentioned in error cookie line is 6th from all the cookies in file. So I suppose to think that first 5 was OK). And I can't understand why:
snapshot n001_2016-05-03_15-10-12

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 3, 2016

The error message indicates a line in cookie.txt should have 7 fields. From your log the 5th field (expiry time) is missing.

@Forket
Copy link

@Forket Forket commented May 3, 2016

But if if cookie expiration value is "session". in this case expiration will be empty. So it means that cookie.txt can't have cookies with expire = session

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented May 3, 2016

My cookies.txt uses 0 as the expiry time for session cookies. A webpage [1] states the same rule. However, I can't find a standard/RFC for that.

[1] http://tutorialspots.com/curl-cookie-file-format-124.html

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
4 participants
You can’t perform that action at this time.