retesere20

youtube-download-funcs

Feb 25th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. public function yout_downl2($yout_video_id, $type =false, $vid_title=false){
  2. $outp = '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><style>a {display:block;text-align:center; background-color:#e7e7e7;border-radius:5px; }</style></head><body>
  3. <div class="fanj" align="center" style="width:600px;margin:0 auto;">
  4. <br/>https://www.youtube.com/watch?v='.$yout_video_id.' ( Alternative Download ):';
  5. if ($type=='video'){
  6. $outp .= '<br/>
  7. <br/><a target="_blank" href="http://www.clipconverter.cc/?ref=bookmarklet&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D'.$yout_video_id.'">2) clipconverter.com</a>
  8. <br/><a target="_blank" href="http://savefrom.net/?url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D'.$yout_video_id.'">3) saveFrom.net</a>
  9. <br/><a target="_blank" href="http://www.fullrip.net/video-m/'.$yout_video_id.'">4) fullrip.net</a>
  10. ';
  11. //http://www.convertfiles.com/
  12. //freefileconvert.com
  13. }
  14. elseif ($type=='audio'){
  15. $outp .= '<br/>
  16. <br/><a target="_blank" href="http://www.youtube-mp3.org/?e=s_exp&r=true#v='.$yout_video_id.'">1) youtube-mp3.org</a>
  17. <br/><form style="display:none;" action="http://convert2mp3.net/en/index.php?p=convert" name="frm1" method="post"><input name="url" value="https://www.youtube.com/watch?v='.$yout_video_id.'" type="text" /> <input name="format" value="mp3" type="text" /><input name="85tvb5" value="242433" type="text" /><input type="submit"></form> <a href="javascript:document.forms[\'frm1\'].submit();">2) convert2mp3.net</a>
  18. <br/><a target="_blank" href="http://www.clipconverter.cc/?ref=bookmarklet&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D'.$yout_video_id.'">3) clipconverter.com(MP3)</a>
  19. ';
  20. //$result = get_remote_data('http://www.force-download.net/getDlLink.php', 'video_url=https://www.youtube.com/watch?v='.$yt_ID); preg_match('/%3Cbr%2F%3E(.*?)\<\/link\>/si',$result,$n); $AUDIO_FILE = urldecode($n[1]).'&title='.$yt_titl.'.mp3';
  21. }
  22. $outp .=
  23. '</div>
  24. <div style="margin:50px 0 0 0; font-style:italic; font-size:13px;">Other download sites: ytconv.net, online-convert.com, fullrip.net, 2conv.com </div>
  25. </body></html>';
  26. return $outp;
  27. }
  28.  
  29. public function yout_DownUrls($viid_id, $titlee='') {
  30. $full_info = get_youtube_data($viid_id);
  31. if (!empty($full_info['url_encoded_fmt_stream_map'])) {
  32. $streams = explode(',',$full_info['url_encoded_fmt_stream_map']); //echo '<pre>';print_r($streams);echo '</pre>';exit;
  33. foreach($streams as $stream){
  34. parse_str($stream, $data);
  35. if(stristr($data['type'], "video/mp4") && $data['quality']=="medium"){
  36. if(empty($titlee)) {$titlee= !empty($data['title']) ? urlencode($data['title']) : (!empty($full_info['title']) ? urldecode($full_info['title']) :'youtube_file');}
  37. $vidLink= urldecode($data['url']).'&title='.$titlee.'_'; break;
  38. //$linkk = $data['url'].'&signature='.$data['sig']; //$linkk="http://127.0.0.1:8182/MVI_1356_1.mp4";
  39. //$json_output = file_get_contents(trim("http://gdata.youtube.com/feeds/api/videos/".$viid_id."?v=2&alt=json"));
  40. //$json = json_decode($json_output, true);
  41. //$video_description = $json['entry']['media$group']['media$description']['$t'];
  42. //$video_counts = $json['entry']['yt$statistics']['viewCount'];
  43. //$video_title3 = urlencode($data['title']);// urlencode($json['entry']['title']['$t']);
  44. //$final_url = urldecode($linkk). '&title='.$video_title3.'';
  45. //$file = fopen('video.'.rand (100, 1000000).str_replace($format,'video/','').".mp4",'w');
  46. //stream_copy_to_stream($video, $file); //fclose($video); readfile($file); //break;
  47. }
  48. }
  49. } else {$vidLink= false;}
  50.  
  51. if (!empty($full_info['adaptive_fmts'])) {
  52. $streams = explode(',',$full_info['adaptive_fmts']); //echo '<pre>';print_r($streams);echo '</pre>';exit;
  53. foreach($streams as $stream){
  54. parse_str($stream, $data); if(stristr($data['type'], "audio/mp4")){ $audLink= urldecode($data['url']).'&title='.$titlee.'_'; break;}
  55. }
  56. } else {$audLink= false;}
  57. return array('vid'=>$vidLink,'aud'=>$audLink,'title'=>$titlee);
  58. }
Add Comment
Please, Sign In to add comment