Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. <?php
  2. // Code đã được edit lại bởi Kai0205 - http://lythanhphuc.com , Download code miễn phí tại ltpvn.net
  3.  
  4. error_reporting(E_ERROR | E_PARSE);
  5.  
  6. function curl($url){
  7. $ch = @curl_init();
  8. curl_setopt($ch, CURLOPT_URL, $url);
  9. $head[] = "Connection: keep-alive";
  10. $head[] = "Keep-Alive: 300";
  11. $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
  12. $head[] = "Accept-Language: en-us,en;q=0.5";
  13. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36');
  14. curl_setopt($ch, CURLOPT_HTTPHEADER, $head);
  15. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  16. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  17. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  18. curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  19. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  20. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  21. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
  22. $page = curl_exec($ch);
  23. curl_close($ch);
  24. return $page;
  25. }
  26.  
  27. function cut_str($str, $left, $right){
  28. $str = substr(stristr($str, $left) , strlen($left));
  29. $leftLen = strlen(stristr($str, $right));
  30. $leftLen = $leftLen ? -($leftLen) : strlen($str);
  31. $str = substr($str, 0, $leftLen);
  32. return $str;
  33. }
  34.  
  35. $url = $_GET['link'];
  36.  
  37. if(isset($url)){
  38. $curTemp = curl($url);
  39. $curTemp = cut_str($curTemp,'url_encoded_fmt_stream_map','"]');
  40. if ($curTemp <> "") {
  41. $curList = explode('\u0026',$curTemp);
  42. foreach ($curList as $curl) {
  43. $curl = trim(substr($curl, strpos($curl,'videoplayback')-strlen($curl)));
  44. $curl = "https://redirector.googlevideo.com/".$curl;
  45. $curl = urldecode($curl);
  46. if ($curl <> "" ){
  47. if (strpos($curl,'itag=37') !== false) {$v1080p=$curl;}
  48. if (strpos($curl,'itag=22') !== false) {$v720p=$curl;}
  49. if (strpos($curl,'itag=59') !== false) {$v480p=$curl;}
  50. if (strpos($curl,'itag=18') !== false) {$v360p=$curl;}
  51. }
  52. }
  53. if($v1080p){
  54. echo '<font color="red">1080p:</font> '.$v1080p.'<br><font color="red">720p:</font> '.$v720p.'<br><font color="red">480p:</font> '.$v480p.'<br><font color="red">360p:</font> '.$v360p;
  55. } elseif($v720p){
  56. echo '<font color="red">720p:</font> '.$v720p.'<br><font color="red">480p:</font> '.$v480p.'<br><font color="red">360p:</font> '.$v360p;
  57. } elseif($v480p){
  58. echo '<font color="red">480p:</font> '.$v480p.'<br><font color="red">360p:</font> '.$v360p;
  59. } else {
  60. echo '<font color="red">360p:</font> '.$v360p;
  61. }
  62. }
  63. }
  64.  
  65.  
  66.  
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement