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

user agent bug #89

Closed
Jamie-Landeg-Jones opened this issue Mar 1, 2011 · 9 comments
Closed

user agent bug #89

Jamie-Landeg-Jones opened this issue Mar 1, 2011 · 9 comments

Comments

@Jamie-Landeg-Jones
Copy link

ok, not exactly serious, but you have the user agent as Gecko/20100101

i.e. 2010 instead of 2011 !!

@bat999
Copy link

bat999 commented Mar 1, 2011

Also still shows Firefox/4.0b11 though Firefox/4.0b12 is now installed.
Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11) Gecko/20100101 Firefox/4.0b11

@bat999
Copy link

bat999 commented Mar 1, 2011

Edit
The Gecko 2010 fault might not be caused by youtube-dl because www.browserspy.dk also shows my browser user agent as 2010 too:-
Mozilla/5.0 (X11; Linux i686; rv:2.0b12) Gecko/20100101 Firefox/4.0b12
Though browserspy does show Firefox/4.0b12 correctly.

@Jamie-Landeg-Jones
Copy link
Author

oh! Weird. Definitely a bug, but not a youtube-dl bug then, sorry! (which rightly 'emulates' the browser)

My firefox shows Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20110125 Firefox/3.6.13

@bat999
Copy link

bat999 commented Mar 1, 2011

Edit again.
Hi
There is a reason why Firefox-4 shows UserAgent year 2010 instead of 2011.
Here:- http://forums.mozillazine.org/viewtopic.php?f=23&t=2102603

@Jamie-Landeg-Jones
Copy link
Author

eeek, thanks... that explains it.

I didn't realise it was the build date, I assumed it was the date of the gecko release..

nasty bit of info to include for those of us who do source builds!

cheers for the detailed reply

@rg3
Copy link
Collaborator

rg3 commented Mar 1, 2011

About the beta 11/12: when I released the latest youtube-dl version, I was using beta 11. Beta 12 hadn't made it yet to my distribution repositories. I literally copied the user-agent string from the browser I was using at the moment.

@bat999
Copy link

bat999 commented Mar 1, 2011

OK
I think that I understand now.
We are using a Mozilla header for youtube-dl so that YouTube thinks it's talking to a browser, not to a download program.
When we use the "--dump-user-agent" command it just tells us which header we are using. It doesn't tell us which browser we are using.

It's here in the code at line 40:-

std_headers = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11) Gecko/20100101 Firefox/4.0b11',
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,;q=0.7',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,
/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-us,en;q=0.5',

}

@rg3
Copy link
Collaborator

rg3 commented Mar 1, 2011

Yes, it's just the header youtube-dl sends, to mimic a web browser.

@Jamie-Landeg-Jones
Copy link
Author

Currently it seems that all you need is the cookies and the url, but it's a good idea to have these to 'fly under the radar' !

joedborg referenced this issue in joedborg/youtube-dl Nov 17, 2020
[pull] master from rg3:master
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants