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

Inconsistent user-agent #3528

Closed
binfalse opened this issue Aug 15, 2014 · 3 comments
Closed

Inconsistent user-agent #3528

binfalse opened this issue Aug 15, 2014 · 3 comments

Comments

@binfalse
Copy link

@binfalse binfalse commented Aug 15, 2014

When calling youtube-dl with a generic (not-explicitly-supported) website it first sends a HEAD request to get the http response code:

https://github.com/rg3/youtube-dl/blob/c990bb36338c422d4da9f092384da1dfbb528d87/youtube_dl/extractor/generic.py#L351

Unfortunately, that call does not set the user-agent. Thus, the web server will see a HEAD request from a Python-urllib/*.* client immediately followed by a GET request from the same client supplying a different (the desired) user-agent.
I am not sure if that also affects other extractors...

@binfalse
Copy link
Author

@binfalse binfalse commented Aug 15, 2014

This apparently not just affects the user-agent but also the proxy settings, which might leak information you do not want to share!

@jlulu
Copy link

@jlulu jlulu commented Aug 24, 2014

Hi binfalse,

I think I found out where the HEAD request is not getting the user-agent added. generic.py is the extractor that gets loaded for non-explicitly-supported websites and it did not have an addheader() method in there to utilize either the default header or one specified.

By affecting the proxy settings, do you mean that the user-agent is inconsistent when the client sends http/https requests to the proxy?

Best regards,
Justin Lulejian

@phihag phihag closed this in ebab452 Aug 24, 2014
@phihag
Copy link
Contributor

@phihag phihag commented Aug 24, 2014

Thank you for the report. I believe this problem to be fixed in youtube-dl 2014.08.24.5 and newer. Type youtube-dl -U to update.

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.