video downloader using PHP - HOW?
Moderator: General Moderators
video downloader using PHP - HOW?
how to create a video downloader using php?
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: video downloader using PHP - HOW?
Care to enlarge on that?
Re: video downloader using PHP - HOW?
our project is a video downloader
it's like getting the url of the video from youtube and click button to download the file.
any idea on how to download a video using php script?
we badly need it.tnx
it's like getting the url of the video from youtube and click button to download the file.
any idea on how to download a video using php script?
we badly need it.tnx
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: video downloader using PHP - HOW?
There is a URL on Youtube that gives you the raw file, but you need the ID of the video, and a special key that is given every time the page is loaded. Use file_get_contents() to get the page, and then extract ID and the key, then put those on the special URL. I think the URL is http://www.youtube.com/get_video?video_id=[video id here]&t=[special key here].
If you look at the source of this userscript you can probably figure out how to extract both of those values.
http://1024k.de/bookmarklets/scripts/vi ... be.user.js
I probably shouldn't ask this, but what's wrong with the other 23,920,438,002 Youtube videos already out there?
If you look at the source of this userscript you can probably figure out how to extract both of those values.
http://1024k.de/bookmarklets/scripts/vi ... be.user.js
I probably shouldn't ask this, but what's wrong with the other 23,920,438,002 Youtube videos already out there?
Re: video downloader using PHP - HOW?
tnx for the info..
i'll try it..
actually our project is an application for facebook
which is a video downloader that can download videos from facebook and youtube
is it also the same on Facebook? like getting the url and those special key?
i'll try it..
actually our project is an application for facebook
which is a video downloader that can download videos from facebook and youtube
is it also the same on Facebook? like getting the url and those special key?
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: video downloader using PHP - HOW?
It should be; I don't know what language you use to make Facebook apps.
Re: video downloader using PHP - HOW?
uhh.,i'm really worried..
i will just use php for both..i hope i can make it..
tnx again..God bless you
i will just use php for both..i hope i can make it..
tnx again..God bless you
-
moeenakhtar
- Forum Newbie
- Posts: 1
- Joined: Mon Aug 16, 2010 12:03 am
Re: video downloader using PHP - HOW?
i worked on facebook app nd used to built these app in php!!!
u will not be getting any prob
u will not be getting any prob
Re: video downloader using PHP - HOW?
ohh really??can u give me the php?just for our project
tnx a lot
tnx a lot
Re: video downloader using PHP - HOW?
how can you download the video from facebook using the url?
can u give me a hint?
can u give me a hint?
Re: video downloader using PHP - HOW?
@jonah: what do you mean by the special key? where can i find that key on youtube??
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: video downloader using PHP - HOW?
Did you look at the userscript I linked to?
It shows right there how to extract the ID and the key. Loop through all script elements and look for that regex. It contains the ID and the key.
Code: Select all
scriptmedia=document.getElementsByTagName('script');
for(i=0;i<scriptmedia.length;++i)
{
source=scriptmedia[i].text.match(/"video_id": "\S+".+"t": "\S+"/i);
Re: video downloader using PHP - HOW?
@ jonah: i can't figure out where you get the variables 1 & 2?
source=String(source).replace(/"video_id": "(\S+)".+"t": "(\S+)"/i,'http:\/\/www.youtube.com\/get_video?video_id=$1&t=$2');
source=String(source).replace(/"video_id": "(\S+)".+"t": "(\S+)"/i,'http:\/\/www.youtube.com\/get_video?video_id=$1&t=$2');
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: video downloader using PHP - HOW?
That's Javascript, not PHP. Variables don't start with $ in Javascript. Those are backward shortcuts for the regex replacement. $0 gives you the entire match, $1 gives you the contents of the first parentheses set, $2 gives you the contents of the second parentheses set, and so on and so forth.
Read this for more info:
http://www.regular-expressions.info/refreplace.html
Read this for more info:
http://www.regular-expressions.info/refreplace.html