From f97d2ef254302cc0444639fff954adc41983d2f2 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sat, 21 Jul 2018 17:45:20 +0200 Subject: [PATCH] [Torrent9Bridge] Remove bridge The site moved from www.torrent9.pe to www.t9.pe and is now protected by Cloudflare challenges, making it inaccessible to RSS-Bridge. --- bridges/Torrent9Bridge.php | 102 ------------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 bridges/Torrent9Bridge.php diff --git a/bridges/Torrent9Bridge.php b/bridges/Torrent9Bridge.php deleted file mode 100644 index 40db4ac..0000000 --- a/bridges/Torrent9Bridge.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'q' => array( - 'name' => 'Search', - 'required' => true, - 'title' => 'Type your search' - ) - ), - 'By page' => array( - 'page' => array( - 'name' => 'Page', - 'type' => 'list', - 'required' => false, - 'values' => array( - 'Series' => self::PAGE_SERIES, - 'Series VOST' => self::PAGE_SERIES_VOSTFR, - 'Series FR' => self::PAGE_SERIES_FR, - ), - 'defaultValue' => self::PAGE_SERIES - ) - ) - ); - - public function collectData(){ - - if($this->queriedContext === 'From search') { - $request = str_replace(' ', '-', trim($this->getInput('q'))); - $page = self::URI . '/search_torrent/' . urlencode($request) . '.html'; - } else { - $request = $this->getInput('page'); - $page = self::URI . '/' . $request . '.html'; - } - - $html = getSimpleHTMLDOM($page) - or returnServerError('No results for this query.'); - - foreach($html->find('table', 0)->find('tr') as $episode) { - if($episode->parent->tag == 'tbody') { - - $urlepisode = self::URI . $episode->find('a', 0)->getAttribute('href'); - - //30 years = forever - $htmlepisode = getSimpleHTMLDOMCached($urlepisode, 86400 * 366 * 30); - - $item = array(); - $item['author'] = $episode->find('a', 0)->text(); - $item['title'] = $episode->find('a', 0)->text(); - $item['id'] = $episode->find('a', 0)->getAttribute('href'); - $item['pubdate'] = $this->getCachedDate($urlepisode); - - $textefiche = $htmlepisode->find('.movie-information', 0)->find('p', 1); - if(isset($textefiche)) { - $item['content'] = $textefiche->text(); - } else { - $p = $htmlepisode->find('.movie-information', 0)->find('p'); - if(!empty($p)) { - $item['content'] = $htmlepisode->find('.movie-information', 0)->find('p', 0)->text(); - } - } - - $item['id'] = $episode->find('a', 0)->getAttribute('href'); - $item['uri'] = self::URI . $htmlepisode->find('.download', 0)->getAttribute('href'); - - $this->items[] = $item; - } - } - } - - - public function getName(){ - if(!is_null($this->getInput('q'))) { - return $this->getInput('q') . ' : ' . self::NAME; - } - - return parent::getName(); - } - - private function getCachedDate($url){ - debugMessage('getting pubdate from url ' . $url . ''); - // Initialize cache - $cache = Cache::create('FileCache'); - $cache->setPath(CACHE_DIR . '/pages'); - $params = [$url]; - $cache->setParameters($params); - // Get cachefile timestamp - $time = $cache->getTime(); - return ($time !== false ? $time : time()); - } -}