Youtube Download Link Generator


/ Published in: PHP
Save to your folder(s)

YouTube Video Download Link Generator
free for all to use, successfulness can't be guaranteed


Copy this code and paste it in your HTML
  1. //YouTube Video Download Link Generator -- jacksont123 (2008)
  2. function str_between($string, $start, $end){ $string = " ".$string; $ini = strpos($string,$start); if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len); }
  3. function get_youtube_download_link(){
  4. $youtube_link = $_GET['youtube'];
  5. $youtube_page = file_get_contents($youtube_link);
  6. $v_id = str_between($youtube_page, "&video_id=", "&");
  7. $t_id = str_between($youtube_page, "&t=", "&");
  8. $flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id";
  9. $hq_flv_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=6";
  10. $mp4_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=18";
  11. $threegp_link = "http://www.youtube.com/get_video?video_id=$v_id&t=$t_id&fmt=17";
  12. echo "\t\tDownload (right-click > save as):\n\t\t";
  13. echo "<a href=\"$flv_link\">FLV</a>\n\t\t";
  14. echo "<a href=\"$hq_flv_link\">HQ FLV (if available)</a>\n\t\t";
  15. echo "<a href=\"$mp4_link\">MP4</a>\n\t\t";
  16. echo "<a href=\"$threegp_link\">3GP</a><br><br>\n";
  17. }

URL: http://youtube.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.