]*@i'; public function Download($link) { if (!preg_match('@https?://trainbit\.com/files/(\d+)@i', str_ireplace('://www.', '://', $link), $fid)) html_error('Invalid link?.'); $this->link = $GLOBALS['Referer'] = $fid[0] . '/'; $this->fid = $fid[1]; $this->page = $this->GetPage($this->link); is_present($this->page, 'Desired file is removed.', 'File Not Found.'); return $this->FreeDL(); } private function FreeDL() { $post = array(); $post['__VIEWSTATE'] = urlencode(cut_str($this->page, '="__VIEWSTATE" value="', '"')) or html_error('__VIEWSTATE Token Not Found.'); $post['__VIEWSTATEGENERATOR'] = urlencode(cut_str($this->page, '="__VIEWSTATEGENERATOR" value="', '"')) or html_error('__VIEWSTATEGENERATOR Token Not Found.'); $post['__EVENTVALIDATION'] = urlencode(cut_str($this->page, '="__EVENTVALIDATION" value="', '"')) or html_error('__EVENTVALIDATION Token Not Found.'); $post['btnDownload'] = 'Get%20Link'; /* Longer Regex: '@