Advertisement
janter13

keepvid curl

Aug 4th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.02 KB | None | 0 0
  1. <?php
  2. function auto($url){
  3. $curl = curl_init();
  4. curl_setopt($curl, CURLOPT_URL,$url);
  5. curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
  6. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
  7. curl_setopt($curl, CURLOPT_HEADER, 1);
  8. curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
  9. $ch = curl_exec($curl);
  10. curl_close($curl);
  11. return($ch);
  12. }
  13.  
  14. ?>
  15. <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
  16. <html xmlns="http://www.w3.org/1999/xhtml">
  17. <head>
  18. <title>
  19. Keepvid
  20. </title>
  21. <link rel="shortcut icon" href="favicon.ico"/>
  22. </head>
  23. <body style="margin: auto; max-width: 640px;">
  24. <span>
  25. Youtube Url :
  26. </span><br>
  27. <form method="post">
  28. <input type="text" name="link" placeholder="http://youtube.com/watch?v=sRFg5pR-Nt4" value="<?php echo (isset($_POST['link'])) ? htmlentities($_POST['link']) : ''; ?>" class="input" style="width:95%">
  29. <br>
  30. <input type="submit" name="post" value="Get Download Link">
  31. </form>
  32. <br>
  33.  
  34. <hr style="background-color:#cccccc;height:1px;border:0px solid #fff;margin:0.3em auto;width:100%;" />
  35. <?php
  36. if(isset($_POST['post'])){
  37. $abc = $_POST['link'];
  38. $baba = auto('http://keepvid.com/?url='.$abc);
  39. $bc = strpos($baba, 'clear="both" /><br /></div>');
  40. $confirms = substr($baba, $bc);
  41. $confir = explode('<a',$confirms);
  42. for($i=1;$i<= count($confir);$i++){
  43. $link = substr($confir[$i-1], strpos($confir[$i-1], 'href=') + 6);
  44. $link = substr($link, 0, strpos($link, '</b>'));
  45. if(ereg('googlevideo', $link)){
  46. $link=str_replace('&amp;','&',$link);  
  47. $link=str_replace('" class="l" style=', '', $link);
  48. $url = substr($link, 0, strpos($link, '"'));
  49. if(ereg('download=', $link)){
  50. $panjang = substr($link, strpos($link, 'download="') + 10);
  51. $judul = substr($panjang, 0, strpos($panjang, '">'));
  52. echo '<a class="fcs" href="'.$url.'">&raquo; '.$judul.'</a><hr style="background-color:#cccccc;height:1px;border:0px solid #fff;margin:0.3em auto;width:100%;" />';
  53. }
  54. }
  55. }
  56. }
  57.  
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement