|
@@ -90,8 +90,38 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "singleDownload") {
|
|
|
$series = curl_download($apiURL . "series/" . $seriesID . "/" . (string) $english[0]->abbreviation . ".xml");
|
|
$series = curl_download($apiURL . "series/" . $seriesID . "/" . (string) $english[0]->abbreviation . ".xml");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $banners = curl_download($apiURL . "series/" . $seriesID . "/banners.xml");
|
|
|
|
|
+ $banners = new SimpleXMLElement($banners);
|
|
|
|
|
+
|
|
|
|
|
+ $poster = $banners->xpath("/Banners/Banner/BannerType[text()='poster']/../Language[text()='" . $german[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($poster) < 1) {
|
|
|
|
|
+ $poster = $banners->xpath("/Banners/Banner/BannerType[text()='poster']/../Language[text()='" . $english[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $seasons = $banners->xpath("/Banners/Banner/BannerType[text()='season']/../BannerType2[text()='season']/../Language[text()='" . $german[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($seasons) > 0) {
|
|
|
|
|
+ foreach($seasons as $season) {
|
|
|
|
|
+ $seasonURL = $bannerURL . $season->BannerPath;
|
|
|
|
|
+ file_put_contents("posters/" . $seriesName . "_" . (string) $season->Season[0] . ".jpg", fopen($seasonURL, 'r'));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $seasons = $banners->xpath("/Banners/Banner/BannerType[text()='season']/../BannerType2[text()='season']/../Language[text()='" . $english[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($seasons) > 0) {
|
|
|
|
|
+ foreach($seasons as $season) {
|
|
|
|
|
+ if(file_exists("posters/" . $seriesName . "_" . (string) $season->Season[0] . ".jpg")) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ $seasonURL = $bannerURL . $season->BannerPath;
|
|
|
|
|
+ file_put_contents("posters/" . $seriesName . "_" . (string) $season->Season[0] . ".jpg", fopen($seasonURL, 'r'));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$series = new SimpleXMLElement($series);
|
|
$series = new SimpleXMLElement($series);
|
|
|
- $poster = (string) $series->Series->poster;
|
|
|
|
|
|
|
+ $poster = $poster[0]->BannerPath;
|
|
|
$poster = $bannerURL . $poster;
|
|
$poster = $bannerURL . $poster;
|
|
|
|
|
|
|
|
file_put_contents("posters/" . $seriesName . ".jpg", fopen($poster, 'r'));
|
|
file_put_contents("posters/" . $seriesName . ".jpg", fopen($poster, 'r'));
|
|
@@ -131,13 +161,42 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "singleDownload") {
|
|
|
$series = curl_download($apiURL . "series/" . $seriesID . "/" . (string) $english[0]->abbreviation . ".xml");
|
|
$series = curl_download($apiURL . "series/" . $seriesID . "/" . (string) $english[0]->abbreviation . ".xml");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ $banners = curl_download($apiURL . "series/" . $seriesID . "/banners.xml");
|
|
|
|
|
+ $banners = new SimpleXMLElement($banners);
|
|
|
|
|
+
|
|
|
|
|
+ $poster = $banners->xpath("/Banners/Banner/BannerType[text()='poster']/../Language[text()='" . $german[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($poster) < 1) {
|
|
|
|
|
+ $poster = $banners->xpath("/Banners/Banner/BannerType[text()='poster']/../Language[text()='" . $english[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $seasons = $banners->xpath("/Banners/Banner/BannerType[text()='season']/../BannerType2[text()='season']/../Language[text()='" . $german[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($seasons) > 0) {
|
|
|
|
|
+ foreach($seasons as $season) {
|
|
|
|
|
+ $seasonURL = $bannerURL . $season->BannerPath;
|
|
|
|
|
+ file_put_contents("posters/" . $name . "_" . (string) $season->Season[0] . ".jpg", fopen($seasonURL, 'r'));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $seasons = $banners->xpath("/Banners/Banner/BannerType[text()='season']/../BannerType2[text()='season']/../Language[text()='" . $english[0]->abbreviation . "']/parent::*");
|
|
|
|
|
+
|
|
|
|
|
+ if(sizeof($seasons) > 0) {
|
|
|
|
|
+ foreach($seasons as $season) {
|
|
|
|
|
+ if(file_exists("posters/" . $name . "_" . (string) $season->Season[0] . ".jpg")) {
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ $seasonURL = $bannerURL . $season->BannerPath;
|
|
|
|
|
+ file_put_contents("posters/" . $name . "_" . (string) $season->Season[0] . ".jpg", fopen($seasonURL, 'r'));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$series = new SimpleXMLElement($series);
|
|
$series = new SimpleXMLElement($series);
|
|
|
- $poster = (string) $series->Series->poster;
|
|
|
|
|
|
|
+ $poster = $poster[0]->BannerPath;
|
|
|
$poster = $bannerURL . $poster;
|
|
$poster = $bannerURL . $poster;
|
|
|
|
|
|
|
|
file_put_contents("posters/" . $name . ".jpg", fopen($poster, 'r'));
|
|
file_put_contents("posters/" . $name . ".jpg", fopen($poster, 'r'));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -153,14 +212,13 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "singleDownloadMovie") {
|
|
|
$movieName = $_REQUEST['moviename'];
|
|
$movieName = $_REQUEST['moviename'];
|
|
|
$movieID = $_REQUEST['movieid'];
|
|
$movieID = $_REQUEST['movieid'];
|
|
|
|
|
|
|
|
- $movie = curl_download("https://api.themoviedb.org/3/movie/" . $movieID . "?api_key=a39779a38e0619f8ae58b09f64522597");
|
|
|
|
|
|
|
+ $movie = curl_download("https://api.themoviedb.org/3/movie/" . $movieID . "?api_key=a39779a38e0619f8ae58b09f64522597&language=de&include_image_language=de");
|
|
|
|
|
|
|
|
if(strpos($movie, 'not be found') !== false) {
|
|
if(strpos($movie, 'not be found') !== false) {
|
|
|
echo "something went wrong";
|
|
echo "something went wrong";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$movie = json_decode($movie);
|
|
$movie = json_decode($movie);
|
|
|
-
|
|
|
|
|
file_put_contents("posters/" . $movieName . ".jpg", fopen($moviePosterURL . $movie->poster_path, 'r'));
|
|
file_put_contents("posters/" . $movieName . ".jpg", fopen($moviePosterURL . $movie->poster_path, 'r'));
|
|
|
|
|
|
|
|
echo "Done.";
|
|
echo "Done.";
|
|
@@ -175,7 +233,6 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "singleDownloadMovie") {
|
|
|
unset($movieName[sizeof($movieName) - 1]);
|
|
unset($movieName[sizeof($movieName) - 1]);
|
|
|
unset($movieName[sizeof($movieName) - 1]);
|
|
unset($movieName[sizeof($movieName) - 1]);
|
|
|
$movieName = implode(' ', $movieName);
|
|
$movieName = implode(' ', $movieName);
|
|
|
-
|
|
|
|
|
$movieName = str_replace(" Directors Cut", "", $movieName);
|
|
$movieName = str_replace(" Directors Cut", "", $movieName);
|
|
|
|
|
|
|
|
pa($movieName);
|
|
pa($movieName);
|
|
@@ -188,35 +245,18 @@ if(isset($_REQUEST['action']) && $_REQUEST['action'] == "singleDownloadMovie") {
|
|
|
$movie = json_decode(curl_download($movieAPIUrl . urlencode($movieName)));
|
|
$movie = json_decode(curl_download($movieAPIUrl . urlencode($movieName)));
|
|
|
|
|
|
|
|
if(sizeof($movie->results) > 1) {
|
|
if(sizeof($movie->results) > 1) {
|
|
|
- // TODO: select thingy
|
|
|
|
|
-
|
|
|
|
|
foreach($movie->results as $result) {
|
|
foreach($movie->results as $result) {
|
|
|
pa($result);
|
|
pa($result);
|
|
|
|
|
|
|
|
echo "<a target=\"_blank\" href=\"?action=singleDownloadMovie&moviename=" . $movieName . "&movieid=" . (string) $result->id . "\">Load</a><br>";
|
|
echo "<a target=\"_blank\" href=\"?action=singleDownloadMovie&moviename=" . $movieName . "&movieid=" . (string) $result->id . "\">Load</a><br>";
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- $poster = $moviePosterURL . $movie->results[0]->poster_path;
|
|
|
|
|
|
|
+ $movie = json_decode(curl_download("https://api.themoviedb.org/3/movie/" . (string) $movie->results[0]->id . "?api_key=a39779a38e0619f8ae58b09f64522597&language=de&include_image_language=de"));
|
|
|
|
|
+
|
|
|
|
|
+ $poster = $moviePosterURL . $movie->poster_path;
|
|
|
file_put_contents("posters/" . $movieName . ".jpg", fopen($poster, 'r'));
|
|
file_put_contents("posters/" . $movieName . ".jpg", fopen($poster, 'r'));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-//pa($list);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-//$movie = json_decode(curl_download($movieAPIUrl . "Lucy"));
|
|
|
|
|
-
|
|
|
|
|
-//pa($movie);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
?>
|
|
?>
|