Advertisement
Guest User

real-debrid_com.php

a guest
Aug 16th, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <?php
  2.  
  3. class dl_real_debrid_com extends Download {
  4.  
  5. public function CheckAcc($cookie){
  6. $json = str_replace("dummy=", "", $cookie);
  7. $json = json_decode($json, true);
  8. if($json["error"] !== 0) {
  9. return [false, $json["message"]];
  10. }
  11. $data = $this->lib->curl("https://real-debrid.com/account", $json["cookie"], "");
  12. if (strpos($data, '<strong>Free</strong>')) {
  13. return [false, "accfree"];
  14. } elseif (strpos($data, '<strong>Premium</strong>')) {
  15. return [true, "Premium till: " . $this->lib->cut_str($data, "Valid untill: <strong>", "<")];
  16. }
  17. return [false, "accinvalid"];
  18. }
  19.  
  20. public function Login($user, $pass){
  21. $data = $this->lib->curl("https://real-debrid.com/ajax/login.php?user=".urlencode($user)."&pass=".urlencode(md5($pass))."&pin_challenge=&pin_answer=PIN%3A+000000&time=".time(), "", "", 0);
  22. if (strpos($data, "}{")) $data = "{". $this->lib->cut_str($data, "}{", "}") . "}";
  23. return "dummy=".$data;
  24. }
  25.  
  26. public function Leech($url) {
  27. $data = $this->lib->curl("https://real-debrid.com/ajax/unrestrict.php?link=".urlencode($url)."&remote=0&time=".time(), $this->lib->cookie, "", 0);
  28. if (strpos($data, "}{")) $data = "{". $this->lib->cut_str($data, "}{", "}") . "}";
  29. $page = json_decode($data, true);
  30. if (strpos($data,"Dedicated server detected") !== false) $this->error("blockIP", true, false);
  31. elseif (isset($page['error'])){
  32. if(isset($page['error']) && $page['error'] == '0') return trim($page['main_link']);
  33. else $this->error("dead", true, false, 2);
  34. }
  35. return false;
  36. }
  37.  
  38. }
  39.  
  40. /*
  41. * Open Source Project
  42. * Vinaget by ..::[H]::..
  43. * Version: 2.7.0
  44. * Real-debrid Download Plugin
  45. * Fix to using "https" (not support PIN) by hogeunk [2016/02/23]
  46. * Show error message when account check by hogeunk [2016/05/08]
  47. */
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement