Giter Club home page Giter Club logo

Comments (35)

jeckman avatar jeckman commented on August 19, 2024

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.

from youtube-downloader.

cristianpana avatar cristianpana commented on August 19, 2024

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]
Către: jeckman/YouTube-Downloader [email protected]
Cc: cristianpana [email protected]
Trimis: Joi, 14 Februarie 2013 15:54:00
Subiect: Re: [YouTube-Downloader] Not working (#1)

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.

Reply to this email directly or view it on GitHub.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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?

from youtube-downloader.

cristianpana avatar cristianpana commented on August 19, 2024

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]
Către: jeckman/YouTube-Downloader [email protected]
Cc: cristianpana [email protected]
Trimis: Joi, 14 Februarie 2013 21:10:33
Subiect: Re: [YouTube-Downloader] Not working (#1)

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?

Reply to this email directly or view it on GitHub.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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.

Is this not what you see?:

Screen Shot 2013-02-14 at 4 17 46 PM

from youtube-downloader.

cristianpana avatar cristianpana commented on August 19, 2024

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]
Către: jeckman/YouTube-Downloader [email protected]
Cc: cristianpana [email protected]
Trimis: Joi, 14 Februarie 2013 23:18:30
Subiect: Re: [YouTube-Downloader] Not working (#1)

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.
Is this not what you see?:

Reply to this email directly or view it on GitHub.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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.

from youtube-downloader.

cristianpana avatar cristianpana commented on August 19, 2024

Hmm still blank page on your site too :)


De la: John Eckman [email protected]
Către: jeckman/YouTube-Downloader [email protected]
Cc: cristianpana [email protected]
Trimis: Joi, 14 Februarie 2013 23:36:32
Subiect: Re: [YouTube-Downloader] Not working (#1)

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.

Reply to this email directly or view it on GitHub.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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

from youtube-downloader.

cristianpana avatar cristianpana commented on August 19, 2024

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.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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:

http://r7---sn-5qoxu-vu2e.c.youtube.com/videoplayback?id=170f8133e32a81e8&key=yt1&upn=I7j3GCl0Rek&cp=U0hVRVlTTl9FTkNONV9RTVJFOmN4NS11V2dYRDgw&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&mt=1360954612&itag=44&ms=au&source=youtube&ratebypass=yes&mv=u&sver=3&expire=1360980404&ipbits=8&fexp=901441,920704,912806,902000,922403,922405,929901,913605,925006,906938,931202,908529,920201,930101,911116,910221,901451,919114&ip=176.223.66.3&newshard=yes&signature=1BAE119EA71940E4770E41D0EFBA412A781B78E7.2829228378FB5776FF6B0BFEA2DF325CA7F5B12E

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:

http://r3---sn-uphxqvujvh-30ae.c.youtube.com/videoplayback?key=yt1&sver=3&id=170f8133e32a81e8&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&cp=U0hVRVlTTl9FTkNONV9RTVJFOkFUb3V1dVljWThJ&upn=UqZmWVdV4mQ&ms=au&itag=44&ip=2600:3c03::f03c:91ff:fe70:f2c0&mv=u&ratebypass=yes&source=youtube&fexp=928010,904828,916625,920704,912806,902000,922403,922405,929901,913605,925006,906938,931202,908529,904830,920201,930101,911116,910221,901451,919114&ipbits=48&newshard=yes&mt=1360955757&expire=1360980404&signature=7653DFC3C4CBCE771D4688D40B321263E4141A1E.D34956D8FA64ECADDB0BE67AE3517D9FC48B8A01

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.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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.

from youtube-downloader.

huglester avatar huglester commented on August 19, 2024

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:
Access to the webpage was denied
You are not authorized to access the webpage at http://r13---sn-p5q7yner.c.youtube.com/videoplayback?algorithm=throttle-.....

Any ideas what I can test else to find a problem?

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

@huglester thanks for the info. I think the issue has to do with one of two things:

  1. The request that the script sends to youtube to get the links, which depending on the server on which the script is running may include an IPv4 address or an IPv6 address.
  2. The timing of the request from the server on which the script is running and the browser where the request originates.

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.

from youtube-downloader.

huglester avatar huglester commented on August 19, 2024

I am currebtly not by the pc.. the error or the white screen took around 1
second.. so it is not a timeout. I could probably try virtuwl machine to
check with your timezone to see if it is a timezone issue.

What timezone do you use?
On Mar 23, 2013 7:57 PM, "John Eckman" [email protected] wrote:

@huglester https://github.com/huglester thanks for the info. I think
the issue has to do with one of two things:

The request that the script sends to youtube to get the links, which
depending on the server on which the script is running may include an IPv4
address or an IPv6 address.
2.

The timing of the request from the server on which the script is
running and the browser where the request originates.

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.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-15341481
.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

@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:

  1. When the get_video_info file is called, if that call occurs over IPv6 but the later request for the data stream comes from IPv4, YouTube doesn't check for a match, and allows the download anyway. This would mean that folks running the script on servers which do IPv4 calls would fail, if their server IP doesn't match their client IP.
  2. When the get_video_info url is called, if the "gl=US" parameter is added, maybe YouTube then only allows streams from the US? (I was originally calling it with "&ps=default&eurl=&gl=US&hl=en" - removing all of those seems to have no effect.) This would mean that non-US users might have the script fail if their server was outside the US or their browsing was.
  3. Maybe the client that is actually downloading the video has to have an active youtube cookie of some kind? I don't think this is true because my podcast downloader successfully uses these links to download video podcasts but it has never visited youtube directly. I tried adding in the video thumbnail on the results page just in case that might trigger the appropriate cookie in the user's browser.
  4. Maybe the "signature" that YouTube provides for each file is expiring. Added debug info which shows the "expires" value YouTube provided, translated into a date/time via PHP. Note this shows the expiration time in the timezone of the server (EDT in my case) - if your server is in a different timezone than your browser, you will need to see if they match.

from youtube-downloader.

sever2k13 avatar sever2k13 commented on August 19, 2024

Hello jeckman;
I tried it.
It's working fine on localhost,but it's not working on server.
Ip based protection doesn't allow to download.It's gives error :
Access Denied
You are not authorized to access the webpage at
http://r6---sn-p5qlsn7e.c.youtube.com/videoplayback?ipbits=48&upn=1vD96Czmh14&expire=1364558804&mt=1364535617&fexp=932000,906383,902000,919512,929903,931202,900821,900823,931203,931401,908529,919373,930803,906836,920201,929602,930101,930603,900824,910223&ms=au&source=youtube&itag=34&key=yt1&mv=m&burst=40&sparams=algorithm,burst,cp,factor,id,ip,ipbits,itag,source,upn,expire&ip=2600:3c03::f03c:91ff:fe70:f2c0&newshard=yes&factor=1.25&sver=3&id=170f8133e32a81e8&cp=U0hVSVVQVl9FTkNONV9NSlpJOnhhZ2t5TmdFbFJ3&algorithm=throttle-factor&signature=1C3FA57530B4FCDF0F2409661BDBFB1B30CA237D.366A33E6DE3AE9BDAA527D09ABD003CEF2586C52
You may need to log on.

Regards.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

@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?

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

@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.

from youtube-downloader.

villagebike avatar villagebike commented on August 19, 2024

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.

from youtube-downloader.

villagebike avatar villagebike commented on August 19, 2024

When I use my VPN to USA it works fine.

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

@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?

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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:

https://github.com/edse/keepvideos

from youtube-downloader.

villagebike avatar villagebike commented on August 19, 2024

When you said "
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)." Is there a way I can request another region specifically?

from youtube-downloader.

c-o-m-m-a-n-d-e-r avatar c-o-m-m-a-n-d-e-r commented on August 19, 2024

Hi, i insert following Code into the curl.php

curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5_0 (Windows; U; Windows NT 6_1; de; rv:1_9_2_8) Gecko/20100722 Firefox/3_6_8" );
curl_setopt( $ch, CURLOPT_COOKIEJAR, "/dev/null" );

and save the video onto my server :-)
$video = curlGet($redirect_url);
$fp = fopen('test.mp4', 'w');
fwrite($fp, $video);
fclose($fp);

Good Luck :-)

from youtube-downloader.

pradeepv3 avatar pradeepv3 commented on August 19, 2024

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?

from youtube-downloader.

c-o-m-m-a-n-d-e-r avatar c-o-m-m-a-n-d-e-r commented on August 19, 2024

Did you try my changes?

from youtube-downloader.

pradeepv3 avatar pradeepv3 commented on August 19, 2024

yes i have copied all your code and added to curl.php Please let me know i have to do anything specific

from youtube-downloader.

c-o-m-m-a-n-d-e-r avatar c-o-m-m-a-n-d-e-r commented on August 19, 2024

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....

from youtube-downloader.

pradeepv3 avatar pradeepv3 commented on August 19, 2024

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

from youtube-downloader.

c-o-m-m-a-n-d-e-r avatar c-o-m-m-a-n-d-e-r commented on August 19, 2024

No thats wrong ... you have to add the 4 Lines

curl_setopt( $ch, CURLOPT_AUTOREFERER, true );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5_0 (Windows; U; Windows NT 6_1; de; rv:1_9_2_8) Gecko/20100722 Firefox/3_6_8" );
curl_setopt( $ch, CURLOPT_COOKIEJAR, "/dev/null" );

in the curl.php ... insert after line 12!

then you can test with single file

$video = curlGet($redirect_url);
$fp = fopen('test.mp4', 'w');
fwrite($fp, $video);
fclose($fp);

$redirect_url is the Link you want to download!

In your Example :

http://r19---sn-o097zne7.c.youtube.com/videoplayback?upn=Bu_z0RAzuGg&ms=au&id=d40ee55731edb516&itag=18&mt=1367854109&sver=3&cp=U0hVTFhSVl9KTkNONV9QTFpCOnBDTkNySHNkZWFF&source=youtube&mv=m&sparams=cp,id,ip,ipbits,itag,ratebypass,source,upn,expire&key=yt1&ip=64.37.52.119&ratebypass=yes&ipbits=8&newshard=yes&fexp=912301,904824,914071,916611,932000,932004,906383,904479,901208,925714,929119,931202,900821,900823,912518,911416,930807,919373,906836,926403,900824,912711,929606,910075&expire=1367878154&signature=383710AAEFF3705E07883CF2905AFF29A3DD908F.4FFB1C275765DBAF5215A315BF389423198D162B

from youtube-downloader.

pradeepv3 avatar pradeepv3 commented on August 19, 2024

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)

from youtube-downloader.

jeckman avatar jeckman commented on August 19, 2024

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

from youtube-downloader.

shadabjaffri avatar shadabjaffri commented on August 19, 2024

Is there any solution for this??

from youtube-downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.