Example #1
0
 function reDownload()
 {
     $JD = new JD($this->A("JDownloadJDID"));
     $s = $JD->download($this->A("JDownloadFilename"), $this->A("JDownloadURL"), $this->A("JDownloadRenameto"), new Serie($this->A("JDownloadSerieID")));
     if ($s) {
         echo "<p>Download gestartet</p>";
     } else {
         echo "<p>Fehler</p>";
     }
 }
 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;
 }
Example #3
0
 public function autoDownload($filename, $page, $targetFileName, Serie $Serie = null)
 {
     if ($this->A("RSSFilterAutoDL") == "0") {
         return false;
     }
     $JD = new JD($this->A("RSSFilterJDID"));
     if (!$JD->supportsAutoDownload()) {
         return false;
     }
     $Adapter = $this->A("RSSFilterAdapter");
     $Adapter = new $Adapter();
     $Adapter->download($this, $filename, $page, $targetFileName, $Serie);
     return true;
 }