Advertisement
Th3-822

[rapidleech][d] tune_pk.php

Dec 12th, 2012
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <?php
  2. if (!defined('RAPIDLEECH')) {
  3.     require_once('index.html');
  4.     exit;
  5. }
  6.  
  7. class tune_pk extends DownloadClass {
  8.     public function Download($link) {
  9.         if (!preg_match('@://(?:[^/]+\.)?tune\.pk/video/(\d+)@i', $link, $vid)) html_error('Video ID not found. Check url.');
  10.         $page = $this->GetPage('http://tune.pk/video/'.$vid[1].'/');
  11.         is_present($page, 'Video does not exist');
  12.         is_present($page, '404 Page not found');
  13.  
  14.         if (!preg_match('@var \s*video_title\s*=\s*\'([^\']+)\';@i', $page, $title)) html_error('Video title not found.');
  15.         $title = str_replace(str_split('<>:"/\\|?*\'@#+~{}[]^'), '_', html_entity_decode(trim($title[1]), ENT_QUOTES));
  16.  
  17.         if (stripos($page, 'watch_video_hd_button') !== false && preg_match('@var \s*hq_video_file\s*=\s*\'(http://[^\']+)\'@i', $page, $dl)) $title .= '_HQ';
  18.         elseif (!preg_match('@var \s*normal_video_file\s*=\s*\'(http://[^\']+)\'@i', $page, $dl)) html_error('Download link not found.');
  19.         $dllink = $dl[1];
  20.  
  21.         $ext = strrchr($dllink, '.');if (empty($ext)) $ext = '.flv';
  22.         $fname = $title . $ext;
  23.         $this->RedirectDownload($dllink, $fname);
  24.     }
  25. }
  26.  
  27. //[12-12-2012] Written by Th3-822.
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement