Th3-822

[rapidleech][d][freedl] my_pcloud_com

Jul 9th, 2016
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) {
  4.     require_once('index.html');
  5.     exit;
  6. }
  7.  
  8. class my_pcloud_com extends DownloadClass {
  9.     public function Download($link) {
  10.         if (!preg_match('@https?://my\.pcloud\.com/publink/show\?code=\w+@i', $link, $_link)) html_error('Invalid link?.');
  11.         $link = $GLOBALS['Referer'] = $_link[0];
  12.  
  13.         if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
  14.  
  15.         $page = $this->GetPage($link);
  16.         if (!preg_match('@var\s+publinkData\s*=\s*(\{.+?\})\s*;@s', $page, $data)) html_error('Filedata Not Found.');
  17.         $data = json_decode($data[1], true);
  18.         if ($data === NULL) html_error('Error while parsing Filedata JSON.');
  19.  
  20.         if (!empty($data['result'])) {
  21.             $data['result'] = htmlspecialchars($data['result'], ENT_QUOTES);
  22.             if (!empty($data['error'])) {
  23.                 $data['error'] = htmlspecialchars($data['error'], ENT_QUOTES);
  24.                 html_error("[Error {$data['result']}] File Error: {$data['error']}");
  25.             }
  26.             html_error('Unknown File Error: ' . $data['result']);
  27.         }
  28.  
  29.         if (empty($data['downloadlink'])) html_error('Download-Link Not Found.');
  30.         return $this->RedirectDownload($data['downloadlink'], 'my_pcloud_com_placeholder');
  31.     }
  32. }
  33.  
  34. // [08-7-2016] Written by Th3-822.
  35.  
  36. ?>
Add Comment
Please, Sign In to add comment