예제 #1
0
 public function download(RSSFilter $RSF, $filename, $page, $targetFileName, Serie $Serie)
 {
     $usableHosts = $this->getAvailableHosts($RSF);
     if (count($usableHosts) == 0) {
         return array("You did not select any hosts to download from", "");
     }
     $JD = new JD($RSF->A("RSSFilterJDID"));
     foreach (self::$links[$page] as $link) {
         $url = parse_url($link);
         #print_r($url);
         #echo $link."\n";
         $found = false;
         foreach ($usableHosts as $host) {
             if (stripos($url["host"], $host) === false) {
                 continue;
             }
             #echo Serie::determineQuality($link);
             #echo $Serie->A("quality");
             if (Serie::determineQuality($link) != SerieGUI::getQualities($Serie->A("quality"))) {
                 continue;
             }
             $found = $link;
         }
         if (!$found) {
             continue;
         }
         try {
             $JD->download($link, $filename, $targetFileName, $Serie);
         } catch (Exception $e) {
         }
         break;
     }
     return true;
 }