-
Notifications
You must be signed in to change notification settings - Fork 468
Not working (for some) #1
Comments
You'll have to be more specific - what did you try to do, and what was not working? I just used it this morning and it is working fine. |
hello, try it yourself http://inbuzunar.mobi/youtube/getvideo.php?videoid=IqEyLPCmQps&type=Download I'm getting a blank page De la: John Eckman [email protected] You'll have to be more specific - what did you try to do, and what was not working? |
Just went to that URL and it works fine for me get a list of 12 versions available for download. Maybe the video in question is geographically restricted? Can you go to http://www.youtube.com/watch?v=IqEyLPCmQps and watch the video there? |
Yes, i can watch that video because it from my country Romania ;) So where it the problem because it not working for me :) De la: John Eckman [email protected] Just went to that URL and it works fine for me get a list of 12 versions available for download. Maybe the video in question is geographically restricted? Can you go to http://www.youtube.com/watch?v=IqEyLPCmQps and watch the video there? |
My friend i see the links, i can see the video on youtube but when i click to download i'm getting a blank page...something like session expired. You want acces to my site to take a look? De la: John Eckman [email protected] Well, ordinarily I would say look at your server error log, but but since it works fine for me at the url you provided I'm at a loss for where to begin. |
Hmm - when I try to use one of the links in your site I get an HTTP 403 status error - not authorized/you may need to sign in. But when I put the same video into the same script on my site: http://johneckman.com/yt/getvideo.php?videoid=IqEyLPCmQps&type=Download It works fine. Try using my url. |
Hmm still blank page on your site too :) De la: John Eckman [email protected] Hmm - when I try to use one of the links in your site I get an HTTP 403 status error - not authorized/you may need to sign in. |
Odd - still works fine for me - even tried a few different browsers to ensure it wasn't some issue with me being logged into to youtube or something. Do you have python on your server? Can you try https://github.com/rg3/youtube-dl - I used their logic for this script, wondering if it works from them. Not sure what else might be different between here and there that makes it work for me but not for you |
I test again with Firefox and Opera latest version and not working, not to my site not from yours.Then i tested with Samsung Galaxy S Advanced with my netwotk conenction and still not working, again blank page (dead links). Btw i don't know python language. |
One last thing to try - if you just go, in a completely fresh browser session (no cookies from youtube of any kind), to http://johneckman.com/yt/ or to http://inbuzunar.mobi/youtube/ and put in the ID again (IqEyLPCmQps), do you get a set of working links? Just passing along the link that contains the ID and type=download doesn't work because that seems to be retrieving outdated data - but opening the index.php in a new session and refetching the flavors does work for me. At this point I'm not sure how to support you further - all I know at this point is it works repeatedly for me in a fresh clean browser using the script as installed at my site with the same video ID you provided. When I have more time I can investigate the difference between the URL that works for me (from my site) and the one that doesn't work for you (from your site) and see what different variables are being passed - maybe has to do with time zones? The google data sends back a key token that has an expiration time in it |
If you look at the query string for one of the downloadable video types on your server you will see that in the querystring is an IP address: The ip in this ur is 176.223.66.3 which nslookup tells me is: core3.spatiul.ro - yet the script itself is on a different server, 176.223.66.54. I'm not sure what that IP is meant by google to represent, but I know that in queries on my own server I get this: Where the IP appears to be an IPv6 address instead of IPv4: 2600:3c03::f03c:91ff:fe70:f2c0 but seems to resolve to linode, where my copy of the script is hosted. So, for one reason or another, the url that Google returns for retrieving the video does include an IP address from which the original call came which generated the signature. Not sure what bits in the querystring are meaningful but obviously somehow the signature big and expires bit are not matching for you - the "expires" seems to be a unix timestamp, as does "mt" (when the info about the primary video was first retrieved?). Somehow google is "sensing" that the browser requesting the video data is not the same one that originally requested the video - but that's true in my case too, yet somehow it works for me. |
Further comparing the two, the only things that vary between the querystring that works for me and the one that doesn't are the ip and ipbits (8 for ipv4, 48 for ipv6), then the MT and Expire values (which makes sense as they were retrieved at different times), then the &cp, &upn, &signature, and &fexp parts. Unfortunately I've no idea what each of those does, and it is the validity of the signature within that expiration window that seems to be the issue - thought again I'm not sure what is expected to be in there. I will let you know if I discover anything useful. |
Hello I found this lib to at least work somehow.. I see the links at this url: http://johneckman.com/yt/getvideo.php?videoid=IqEyLPCmQps&type=Download But I get a whit screen from firefox too :( In chrome, I get more verbose message: Any ideas what I can test else to find a problem? |
@huglester thanks for the info. I think the issue has to do with one of two things:
Basically the script requests data (server side) from YouTube, and that data includes a "signature" token with an expiration date - if the next request (which is the browser requesting the new link) doesn't match the signature (as a result of the first issue above, the IP address not matching, which it seems to not check if it is IPv6, or as a result of the second issue, due to timezone differences) the error appears. I'm going to make a debug option to show more data and dig into a bit - it will be helpful once I've done so to have some folks try it from other time zones and/or have it installed on multiple different servers to test. |
I am currebtly not by the pc.. the error or the white screen took around 1 What timezone do you use?
|
@huglester - can you try again? I added some debug info (there is now a "debug info" checkbox on the form, or just add "&debug=on" to the query string. I think there are potentially a number of different things going on here. YouTube seems to expect/require that the machine on which the format string decoding occurs (where the script runs) have the same IP as the browser which will ultimately request the files. However, I know that isn't always the case, because I use a podcast downloader on my iPad which downloads using these links successfully - so for at least one use case (my actual primary use!) this restriction is not in place. I also noticed that the get_video_info url that I am calling to get the format stream links previously included a value that suggests it was looking for a region of US - so it may be that IPs outside the US were getting denied. (I've removed that parameter now). Finally, it seems like when it runs on my server (johneckman.com/yt/) what cURL passes to youtube is an IPv6 address (40 bits) not an IPv4 address (8bits). Maybe this is why it works on my server and not on others? The debug info will show you if yours is passing IPv4 or IPv6. So, I'm thinking that one of these things is causing the isse:
|
Hello jeckman; Regards. |
@sever2k13 - what was shown on the page listing the videos? Did you try it with the "debug info" checked? It looks from the url you provided like your server was using IPv6, so that wouldn't be the issue - how about the "expires" value? On the download links page when you run the script if you check "show debug info" it should tell you when it thinks the links will expire. Are you (your browser and/or server) outside the US? Are you and your server in the same time zone? |
@sever2k13 Interestingly, that link in your comment did just work for me, in Chrome (where I might have youtube cookies or be logged in already) and in Opera (no cookies, no login, no previous youtube visit). Still not sure why it is working for me and not others. |
same for me. It includes the IP of the server in the URL as opposed to the client. When you look at ssyoutube.com, the link includes the IP of the client. |
When I use my VPN to USA it works fine. |
@iamzug Thanks for following up. So what I'm taking away from the discussion is that if you have both IPV6 on the server (so that the IP isn't matched) AND a US IP address, then it works. Or is that you need IPv6 and you need an IP address (client) in the same region as the ip address of the server? |
People for whom the script is not working might want to check out this project, which uses JavaScript to do the parsing on the client side, removing the IP issues: |
When you said " |
Hi, i insert following Code into the curl.php curl_setopt( $ch, CURLOPT_AUTOREFERER, true ); and save the video onto my server :-) Good Luck :-) |
Hi, am able to download the videos in localhost, but am not able to download in my server. when i open the download link it says Access to the webpage was denied. URL: http://demo.pradeep-designer.com/youtube/getvideo.php?videoid=1A7lVzHttRY&debug=on&type=Download. Even "https://github.com/edse/keepvideos" works in localhost not in server. any help? |
Did you try my changes? |
yes i have copied all your code and added to curl.php Please let me know i have to do anything specific |
mhhh... do you try manuel saving with my code above? I don't test the example with my changes... i just make changes to curl.php and save it manuellly with these 4 lines of code.... |
i have added all your 8 line of code in curl.php is that correct or i have to add it some other page. Manual save as is not working |
No thats wrong ... you have to add the 4 Lines curl_setopt( $ch, CURLOPT_AUTOREFERER, true ); in the curl.php ... insert after line 12! then you can test with single file $video = curlGet($redirect_url); $redirect_url is the Link you want to download! In your Example : |
Hi still same result i have added your 4 line code after the below code curl_setopt( $ch , CURLOPT_RETURNTRANSFER , 1 ); and i have created a new page download.php with other set of code http://demo.pradeep-designer.com/youtube/download.php (please view source to see the code) |
Thanks to a pull request from sepehr there's now a simple proxy download option, which uses php readfile() to get the file from the remote url on the server and pass through to the browser. This should help folks whose servers have ipv4. Your server still needs to be able to use fopen with url wrappers - some hosts disallow this |
Is there any solution for this?? |
Hello friend,
I just test your little script and don't work anymore. Btw sometimes if a video it not HD, the script will not show the rest of the links.
The text was updated successfully, but these errors were encountered: