I have develop a media website to play video from Youtube by using jPlayer in PHP. I have a problem with getting actual Youtube download link to make it play in my jPlayer.
Suppose that I have a Youtube link: and my actual download link is: ;sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=919109%2C911646%2C920917%2C922401%2C920704%2C912806%2C913419%2C913558%2C913556%2C925109%2C912706&ms=nxu&expire=1348071130&itag=18&ipbits=8&gcr=kh&sver=3&ratebypass=yes&mt=1348046463&ip=119.15.90.10&mv=m&source=youtube&key=yt1&cp=U0hTTVBST19ISkNOM19ITFNCOmNBYVpWN2FtYXpn&id=ce97cd785580daf1&signature=74DF90D5D04F4DA2A2D588BDAFE777594673D2EE.64E845538B00C1FAA2E0AC043DAB5C512A49E45D&redirect_counter=1&cms_redirect=yes.
This actual url will expired on the next day.
Is there any method which I can paste only onto jPlayer or a script in either PHP or Javascript which can generate that actual link?
Note
I have download phptube from .html. It's working but when I download video from this generate link it said that "I don't have permission to download this file. 403 Forbidden"
Thank for helping!
I have develop a media website to play video from Youtube by using jPlayer in PHP. I have a problem with getting actual Youtube download link to make it play in my jPlayer.
Suppose that I have a Youtube link: https://www.youtube./watch?v=zpfNeFWA2vE and my actual download link is: http://o-o---preferred---hkg05s03---v12---nonxt5.c.youtube./videoplayback?upn=PnVtBEZ_KJw&sparams=cp%2Cgcr%2Cid%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&fexp=919109%2C911646%2C920917%2C922401%2C920704%2C912806%2C913419%2C913558%2C913556%2C925109%2C912706&ms=nxu&expire=1348071130&itag=18&ipbits=8&gcr=kh&sver=3&ratebypass=yes&mt=1348046463&ip=119.15.90.10&mv=m&source=youtube&key=yt1&cp=U0hTTVBST19ISkNOM19ITFNCOmNBYVpWN2FtYXpn&id=ce97cd785580daf1&signature=74DF90D5D04F4DA2A2D588BDAFE777594673D2EE.64E845538B00C1FAA2E0AC043DAB5C512A49E45D&redirect_counter=1&cms_redirect=yes.
This actual url will expired on the next day.
Is there any method which I can paste only https://www.youtube./watch?v=zpfNeFWA2vE onto jPlayer or a script in either PHP or Javascript which can generate that actual link?
Note
I have download phptube from http://www.masnun.me/2011/05/17/phptube-a-php-class-to-get-download-links-from-youtube-watch-videos.html. It's working but when I download video from this generate link it said that "I don't have permission to download this file. 403 Forbidden"
Thank for helping!
Share Improve this question asked Sep 19, 2012 at 9:27 PenganPengan 1,8234 gold badges15 silver badges16 bronze badges 1- 2 I don't think that this is allowed by YouTube. – nkr Commented Sep 19, 2012 at 10:30
2 Answers
Reset to default 2Are you making sure that when you generate the youtube download links with phptube you are also accessing them from the server (and not from the client machine)? You are allowed to access these download links only from the same machine that was used to generate them (the author of phptube
states that right at the beginning of the article).
A solution would be to generate these links from your server. Then use the server to download the contents to it. Then use the downloaded file to display it to the user. The problem is that your server will have to use double the bandwidth and the process will need time. YouTube just won't let you share the download links directly.
I had the exact same problem! Than I found this:
http://navarr.me/ytaudio/?q=http%3A%2F%2Fwww.youtube.%2Fwatch%3Fv%3DtvS5MLzJfAw&s=on&psize=s&theme=dark
the source: https://github./navarr/ytaudio/
This script is also creating a download link like phptube. But I can acces the video from my local pc!