Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Sometimes I get 403 errors #526
Comments
|
What the fuck ... root@mybase: curl 'http://o-o---preferred---sn-25g7rn7z---v3---lscache7.c.youtube.com/.....' -L > video2 curl works, without cookies! (only with the parameter ('-L')) and now axel... super fast but.. root@mybase:# axel 'http://o-o---preferred---sn-25g7rn7z---v3---lscache7.c.youtube.com/.....' > video3 but why?! |
|
Hm, I'm not getting any issue, neither with curl nor axel, the video just gets downloaded correctly. Do you have any particular URLs for which it doesn't always work, or does it seem random? As a side note, if you used the same URLs twice, that may be the reason your second download got refused. If you try to download a video and then try it again a bit later, it may not work since the link may have expired, or be deleted since it's already been used. Do you get a 403 error if you try with axel first? |
|
Thanks. I've found the problem. In my script the url has not escaped. axel $url Sometimes error. why?! axel "$url" No Exception. But why has he given only SOMETIMES an error message? Thats funny.. |
|
Ah, right, I thought you already did that. Not sure, might be because of the way YouTube reacts to malformed URLs. Regardless, as long as it works now, it's all good! |
|
Probably breaks only if shell meaningful chars get into the url, and this might be random. Nice to hear the issue is solved, closing. |
|
root@y:/home/product# axel 'YOUTUBE-URL' -o test root@y:/home/product# curl -L 'YOUTUBE-URL' > test curl works.. axel dont work :-/ yesterday it still worked. Now comes the 403 error. What now? :-/ |
|
Umh... the User-Agent? You should supply the youtube-dl one to axel. |
|
But why it works that way with wget, curl, etc? Sometimes it is also with axel, but only sometimes. |
|
Well, it might be the different User-Agent, but my best bet would be that the axel download gets killed as it opens too much concurrent connections. |
|
root@y:~# axel -n 1 -U 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11' '$url' Only 1 Connection and same useragent. and.. 403 error :-/ Can you maybe try with Axel? The YT Url is: http://www.youtube.com/watch?v=4wOoLLDXbDY. |
Download then continues and finishes normally. I tried it at least five times, each time getting a different URL from YouTube since I'm making youtube-dl make a new request each time, and it seems to work with or without a "proper" user agent, at least for me. |
|
root@y:# axel Can you please paste this: |
|
Seems you're using an old version of youtube-dl, given that debug output you get. You should try compiling the latest version, I don't know if it's related to your issue, I doubt it, but it's worth trying. Anyway:
The youtube-dl version I use is the latest as I regularly update my local repository to match the current version. |
|
root@y: What do the numbers at the beginning? I've even tested on a different server, there it worked. |
|
This is some debug output left there by mistake. It's been fixed in commit 5d40a47, which means you're using an outdated version. As I said, I don't think the issues are related, but it's always good to have the latest version. The only thing I can think of that would cause this problem is that axel downloads the video with a different IP that youtube-dl uses when requesting the URL of the video. Maybe one is using a proxy while the other isn't. If it works with curl or wget, maybe you could try something like this:
Then, check the files ip.txt and ip2.txt. If they don't have the same IP, that's the issue. If they do, then...I'm afraid I'm out of ideas, sorry. |
|
Thanks for your help. The IP addresses are the same. |
|
Do you mean the debug output, or the version number from youtube-dl? The version number isn't updated automatically, and the youtube-dl binary provided here isn't always up to date either. The only way to ensure you actually do have the latest version is to clone the repository and use As for why it works on a server and not on another, I can only guess it's a connectivity or proxy issue that only happens on one of the server, and not the other. That sounds inconvenient but I'm afraid there's nothing youtube-dl can do about that, as it seems to be more related to axel than anything. |
|
As a last chance, I would try (updating and) passing also the cookies to axel. We have an option for that. |
|
Okay. root@y:/home# youtube-dl "http://www.youtube.com/watch?v=RQaz8VFTzlQ&feature=related" These numbers are still there, although "# print >> sys.stderr, self.getpos ()" is commented out. Why? |
|
So, I have the solution! root @ y :/ home # youtube-dl-g 'http://www.youtube.com/watch?v=4wOoLLDXbDY' | xargs curl-I And then: axel "$ new url" and WORKS! Thanks to you :) |
Hello guys,
i use youtube-dl for download my music. But sometimes I get a 403 error.
url=
youtube-dl --user-agent 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11' -g --skip-download --write-info-json --cookies cookie.y2m -o source $1 | tail -n 1 -cookie=$( cat cookie.y2m | awk '{printf("%s=%s;",$6,$7)}' )
axel -U 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11 ' -H "Cookie: $cookie" $url
(axel is a downloader (like wget))
Very funny! Sometimes it works, sometimes not! But why..?
Thanks :)