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

Cookie option #1365

Closed
vanilla38 opened this issue Sep 3, 2013 · 4 comments
Closed

Cookie option #1365

vanilla38 opened this issue Sep 3, 2013 · 4 comments

Comments

@vanilla38
Copy link

@vanilla38 vanilla38 commented Sep 3, 2013

Hello, since i still did not understand on what this option consists and i cant find any good description, can anyone explain me what it does and how to use it since i heard about a necessary user agent option. Thanks.

@phihag
Copy link
Contributor

@phihag phihag commented Sep 3, 2013

For normal use (i.e. downloading videos), you don't need either of the --cookies FILE (where FILE is the file to read cookies from and dump the cookie jar in) or --user-agent options. Both are only needed for advanced use (external downloaders or debugging).

@phihag phihag closed this Sep 3, 2013
@yasoob
Copy link
Contributor

@yasoob yasoob commented Sep 3, 2013

I am also getting curious where EXACTLY can the --cookies flag be used. How is it helpful with external Downloaders ? Just want a little elaboration.

@phihag
Copy link
Contributor

@phihag phihag commented Sep 3, 2013

Some video services (youtube in some cases, it depends) only allow downloads from the final URL if it can be associated with the extractor. Therefore, they set cookies during extraction/player setup, and throw out an error when somebody tries to download without those exact cookies.

If that's the case, the external downloader needs to supply the same cookies to the server. For example, if you want to download using wget, you could execute

URL=youtube-dl --get-url --cookies cookiefile.tmp http://www.youtube.com/watch?v=WX6s-9hv800
wget --load-cookies cookiefile.tmp $URL

But as I wrote above, that's really an inferior way to embed a downloader, since it's error-prone (the cookie file will be overwritten if you run this command multiple times in parallel, for example) and relies on an external script. For instance, can you spot the two mistakes in the wget invocation above? It's way easier and more reliable to just include necessary features into youtube-dl itself.

@vanilla38
Copy link
Author

@vanilla38 vanilla38 commented Sep 3, 2013

Thanks for these explanations.

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.