Advertisement
Th3-822

[rapidleech][d] cloudtime_to

Aug 26th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.17 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit;
  6. }
  7.  
  8. class cloudtime_to extends DownloadClass {
  9.     public function Download($link) {
  10.         $page = $this->GetPage($link);
  11.         is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
  12.         is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');
  13.  
  14.         if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
  15.             $post = array('stepkey' => $stepkey, 'submit' => 'submit');
  16.             $cookie = GetCookiesArr($page);
  17.             $page = $this->GetPage($link, $cookie, $post);
  18.             is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
  19.             is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
  20.         }
  21.  
  22.         if (!preg_match('@<div class="video_det">\s*<strong>\s*([^"<>]+)\s*</strong>@i', $page, $title)) html_error('Error: Video title not found.');
  23.         if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
  24.         if (empty($matches[3])) {
  25.             if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
  26.             $matches[3] = $fkey[1];
  27.         }
  28.  
  29.         $url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
  30.         $page2 = $this->GetPage($url);
  31.         is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
  32.    
  33.         if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  
  34.  
  35.         if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
  36.         $filename = preg_replace('@\.(mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp)$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
  37.         $filename .= sprintf(' [CloudTime][%s]%s', $matches[2], $ext[0]);
  38.  
  39.         $this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
  40.     }
  41. }
  42.  
  43. //[28-12-2015]  ReWritten by Th3-822.
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement