niammuddin

download video youtube

Mar 26th, 2015
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?php
  2. $id=$a['id'];
  3. $dt=file_get_contents("http://www.youtube.com/get_video_info?video_id=$id&asv=3&el=detailpage&hl=en_US");
  4. $x=explode("&",$dt);
  5. $t=array(); $g=array(); $h=array();
  6. foreach($x as $r){
  7. $c=explode("=",$r);
  8. $n=$c[0]; $v=$c[1];
  9. $y=urldecode($v);
  10. $t[$n]=$v;
  11. }
  12. $streams = explode(',',urldecode($t['url_encoded_fmt_stream_map']));
  13. foreach($streams as $dt){
  14. $x=explode("&",$dt);
  15. foreach($x as $r){
  16. $c=explode("=",$r);
  17. $n=$c[0]; $v=$c[1];
  18. $h[$n]=urldecode($v);
  19. }
  20. $g[]=$h;
  21. }
  22. //print_r($g);
  23. echo '<div style="clear:both;margin-bottom:10px;">';
  24. echo '<span class="vd">DOWNLOAD VIDEO</span>';
  25. foreach($g as $format)
  26. {
  27. $type = explode(';',$format['type'] );
  28. $types = $type[0];
  29. $size = formatBytes(get_size($format['url']));
  30. echo '<span class="vd"><a target="_blank" href="'.urldecode($format['url']).'">'.$size.'</a></span>';
  31. }
  32. echo '</div>';
  33. ?>
Add Comment
Please, Sign In to add comment