Advertisement
Guest User

Untitled

a guest
May 8th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.87 KB | None | 0 0
  1. <?php
  2. $cookie_file = './cookie.txt';
  3.  
  4. function connect(){
  5. $username = "UTB_User";
  6. $password = "UTB_PASSWORD";
  7. $loginUrl = 'http://uptobox.com/';
  8. $ch = curl_init();
  9. curl_setopt($ch, CURLOPT_URL, $loginUrl);
  10. curl_setopt($ch,CURLOPT_HEADER,false);
  11. curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
  12. curl_setopt($ch,CURLOPT_FOLLOWLOCATION,false);
  13. curl_setopt($ch, CURLOPT_NOPROGRESS, false);
  14. // ENABLE HTTP POST
  15. curl_setopt($ch, CURLOPT_POST, true);
  16. //Set the post parameters
  17. curl_setopt($ch, CURLOPT_POSTFIELDS, 'login='.$username.'&password='.$password.'&redirect=http://uptobox.com/&op=login&x=12&y=6');
  18. //Handle cookies for the login
  19. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");
  20. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");
  21. $store = curl_exec($ch);
  22. }
  23.  
  24.  
  25. function recup_lien($lien){
  26. $cur = curl_init();
  27. curl_setopt($cur, CURLOPT_URL, $lien);
  28. curl_setopt($cur,CURLOPT_HEADER,true);
  29. curl_setopt($cur,CURLOPT_RETURNTRANSFER,true);
  30. curl_setopt($cur,CURLOPT_FOLLOWLOCATION,false);
  31. curl_setopt($cur, CURLOPT_NOBODY, true);
  32. curl_setopt($cur, CURLOPT_COOKIEJAR, "cookie.txt");
  33. curl_setopt($cur, CURLOPT_COOKIEFILE, "cookie.txt");
  34.  
  35.  
  36. $link = curl_exec($cur);
  37. if (preg_match('#Location: #Ui', $link, $lien)) {
  38. $car = explode(' ', $link);
  39. $lien = preg_replace("(\r\n|\n|\r)",' ',$car[11]);
  40. $lien = explode(' ', $lien);
  41. $lien = $lien[0];
  42. return $lien;
  43. }
  44. curl_close($cur);
  45. }
  46.  
  47. ?>
  48. <div class="blocktable">
  49. <h2><span>Regarder un film sur Real-Univers</span></h2>
  50. <div class="box">
  51. <div class="inbox">
  52. <?php
  53. if(isset($_GET['id']) && $_GET['id'] == intval($_GET['id'])) {
  54. $id = $_GET['id'];
  55.  
  56. $result = $db->query('SELECT * FROM '.$db->prefix.'posts WHERE id = '.$id);
  57. $is = $db->fetch_assoc($result);
  58.  
  59. if(preg_match_all("#http\:\/\/(www\.|)uptobox\.com\/[a-zA-Z0-9]{12}#", $is['message'], $lien)){
  60. connect();
  61. if(count($lien[0]) == 1){
  62. $link = recup_lien($lien[0][0]);
  63. if (substr($link, -3) != 'rar' && substr($link, -3) != 'zip') {
  64. ?>
  65. <div class="player">
  66. <embed type="application/x-vlc-plugin" name="VLC" autoplay="no" loop="no" volume="100" width="955" height="537" target="<?php echo $link ?>">
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <?php
  74. }
  75. }
  76. }
  77.  
  78. }else{
  79. header('Location: index.php');
  80. }
  81.  
  82. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement