How to get the YouTube video(.flv) path in a PHP variable ..
Suppose from a youtube video url it will fetch the video downloadable url link..something like this:
http://tc.v15.cache3.c.youtube.com/videoplayback?algorithm=throttle-factor&burst=40&cp=U0hTSVNRUV9LTUNOM19LS1VIOlZ1V2M5YUd5RVNM&expire=1344363763&factor=1.25&fexp=906430%2C913529%2C915507%2C907217%2C919804%2C920704%2C912806%2C906055%2C924500%2C925701%2C924700%2C911406%2C913547%2C904721%2C920706%2C907344%2C912706%2C900816%2C902518%2C909414&id=5d4df8214f695e43&ip=184.95.55.18&ipbits=8&itag=5&keepalive=yes&key=yt1&ms=au&mt=1344338530&mv=m&signature=C0012A45BF4240C299C6755507BCC6C24F291153.8F40151E7E3331B9524A54F168FB3BF0C4BFFA63&source=youtube&sparams=algorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire&sver=3&upn=OHj8ucDOV7c
So i will have like this. $vurl= this_types_of_video_url;
any idea?
Asked
Active
Viewed 1,023 times
-6

blömpæ
- 375
- 2
- 12
2 Answers
3
There is no YouTube Video ID variable in the URL example you put into the question in the first place. Also, .flv
download sites have been given cease and desist inquire from Google.
If there would be, your way to fetch the URL would be using the preg_match()
function which helps you to match a regular expression pattern on the URL.
The other option would be using the parse_url()
and parse_str()
functions.
The method described in this answer should set you on the right track.

Community
- 1
- 1

Whisperity
- 3,012
- 1
- 19
- 36
0
Scape the page?
- Find the player JavaScript-block.
- Escape the JavaScript-block and extract the player variables.
- Fetch the query string for the variables.
- Find the stream map (url_encoded_fmt_stream_map), again, a query string.
- Iterate through each item in the map, split by comma and again, a query string.
- Profit!

albertjan
- 7,739
- 6
- 44
- 74

Deathspike
- 8,582
- 6
- 44
- 82