Advertisement
Th3-822

[rapidleech][d] thevideo_me

Apr 23rd, 2017
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.85 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit();
  6. }
  7.  
  8. if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
  9. require_once(HOST_DIR . 'download/GenericXFS_DL.php');
  10.  
  11. class thevideo_me extends GenericXFS_DL {
  12.     public $pluginVer = 20;
  13.     public function Download($link) {
  14.         $this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
  15.         $this->cname = 'xfsts'; // Session cookie name
  16.         $this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
  17.         $this->sslLogin = false; // Force https on login post only.
  18.         $this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
  19.         $this->unescaper = false; // Enable JS unescape decoder
  20.  
  21.         // Custom Download Regexp
  22.         $this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(?:files|dl?|cgi-bin/dl\.cgi|[\da-zA-Z]{30,})/(?:[^\?\'\"\t<>\r\n\\\]{15,}|v(?:id(?:eo)?)?\.(?:flv|mp4))@i';
  23.  
  24.         $this->Start($link);
  25.     }
  26.  
  27.     protected function checkLogin($page) {
  28.         $return = parent::checkLogin($page);
  29.         $cookie = GetCookiesArr($page);
  30.         if (!empty($cookie['msg'])) {
  31.             $err = htmlspecialchars(trim(rawurldecode($cookie['msg'])));
  32.             is_present($err, 'Captcha is required', 'Login Is Asking For Captcha, Login with Cookie Instead');
  33.             return html_error('Login Error: ' . $err);
  34.         }
  35.         return $return;
  36.     }
  37.  
  38.     // I'm playing 'The Game' :P
  39.     protected function testDL() {
  40.         if (!empty($this->enableDecoders)) $this->runDecoders();
  41.  
  42.         if (preg_match_all($this->DLregexp, $this->page, $DL)) {
  43.             $DL = array_reverse($DL[0]);
  44.  
  45.             if (!preg_match('@var\s+[\$_A-Za-z][\$\w]*\s*=\s*(\'|\")([\d\w+/=]{13,})\1@i', $this->page, $token)) html_error('[Error] Stream Token Not Found');
  46.             $token = $token[2];
  47.  
  48.             $page = $this->GetPage($this->purl . 'vs'.'ig'.'n/pl'.'ayer/' . $token);
  49.             if (!preg_match_all('@eval\s*\(\s*function\s*\(p,a,c,k,e,r\)\s*\{.+\}\s*\(\s*\'([^\r|\n]*)\'\s*,\s*\[\]\s*,\s*(\d+)\s*,\s*\'([^\']+)\'\.split\([\'|\"](.)[\'|\"]\)(?:\s*,\s*0\s*,\s*\{\})?\)\)@', $page, $js)) html_error('[Error] Encoded Stream Token Not Found');
  50.             $cnt = count($js[0]);
  51.             for ($i = 0; $i < $cnt; $i++) {
  52.                 $page = str_replace($js[0][$i], $this->XFSUnpacker($js[1][$i], 36, $js[2][$i], $js[3][$i], $js[4][$i]), $page);
  53.             }
  54.             if (!preg_match('@[\da-z]{50,}@', $page, $decToken)) html_error('[Error] Decoded Stream Token Not Found');
  55.  
  56.             $this->RedirectDownload($DL[0] . '?down'.'load=true&v'.'t=' . $decToken[0], basename($this->getFileName($DL[0])));
  57.             return true;
  58.         }
  59.         return false;
  60.     }
  61.  
  62.     protected function getVideoTitle() {
  63.         if (preg_match('@<h2 class="page-header text-overflow">\s*([^"<>]+)\s*</h2>@i', $this->page, $title)) {
  64.             return html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8');
  65.         }
  66.         return false;
  67.     }
  68. }
  69.  
  70. // Written by Th3-822.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement