Commit 7490ad9e authored by Nico Schallehn's avatar Nico Schallehn

test

parent 4191cc09
......@@ -777,6 +777,9 @@ class Media {
$counterNotFound = 0;
//shell_exec("rm ".$this->config["CoverDir"]."Filme/full/*");
while ($Film = $result->fetch_assoc()){
$url = "https://api.themoviedb.org/3/find/tt".$imdbID."?external_source=imdb_id&api_key=".$this->config["ApiKeys"]['Tmdb_Key']."&language=de".PHP_EOL; //$this->config["ApiKeys"]['Tmdb_Key']
$tmdb = $this->jsonCacheDecoder($url);
if(!file_exists($this->config["CoverDir"]."Filme/full/".$Film["imdbID"].".jpg")){
echo "Lade Cover (".$Film["imdbID"].") von Markus ....";
$url = "http://mediadb.ddns.net/cover/Filme/full/".$Film["imdbID"].".jpg";
......@@ -787,10 +790,16 @@ class Media {
$imdb = new IMDB("http://www.imdb.com/title/tt".$Film["imdbID"]."/");
$url = $imdb->getPoster("big");
if(strpos($url, "imdb-share")>3){
if(isset($tmdb["movie_results"][0]["poster_path"])){
$url = "https://image.tmdb.org/t/p/original".$tmdb["movie_results"][0]["poster_path"];
shell_exec("wget ".$url." -O ".$this->config["CoverDir"]."Filme/full/".$Film["imdbID"].".jpg > /dev/null 2>&1");
echo "done!".PHP_EOL;
}else {
//TODO 3. Quelle für cover einbauen
echo " fail (Kein Cover gefunden)!".PHP_EOL;
file_put_contents("./phpTestout/cover.txt", "Kein Cover für ".$Film["imdbID"].PHP_EOL, FILE_APPEND);
$counterNotFound++;
}
}else{
shell_exec("wget ".$url." -O ".$this->config["CoverDir"]."Filme/full/".$Film["imdbID"].".jpg"." > /dev/null 2>&1");
echo "done !".PHP_EOL;
......@@ -821,13 +830,30 @@ class Media {
echo "done!".PHP_EOL;
}else{
echo "fail (Kein Hintergrundbild gefunden)!".PHP_EOL;
file_put_contents("./phpTestout/cover.txt", "Kein Hintergrundbild für ".$Film["imdbID"].PHP_EOL, FILE_APPEND);
file_put_contents("./phpTestout/cover.txt", "Kein Hintergrundbild für ".$Film["imdbID"]." auf fanart.tv".PHP_EOL, FILE_APPEND);
$counterNotFound++;
}
}else{
echo "fail (Film nicht gefunden)!".PHP_EOL;
$counterNotFound++;
}
if(!file_exists($this->config["CoverDir"]."Filme/background/".$Film["imdbID"].".jpg")){
echo "Lade Hintergrundbild für (".$Film["imdbID"].") von themoviedb.org ....";
if(isset($tmdb["movie_results"][0]["backdrop_path"])){
$url = "https://image.tmdb.org/t/p/original".$tmdb["movie_results"][0]["backdrop_path"];
shell_exec("wget ".$url." -O ".$this->config["CoverDir"]."Filme/background/".$Film["imdbID"].".jpg > /dev/null 2>&1");
echo "done!".PHP_EOL;
}else{
echo "fail (Kein Hintergrundbild gefunden)!".PHP_EOL;
file_put_contents("./phpTestout/cover.txt", "Kein Hintergrundbild für ".$Film["imdbID"]." auf tmdb.org".PHP_EOL, FILE_APPEND);
$counterNotFound++;
}
}
}
}
echo $this->Console->getColoredString("Coverdownload > Serien und Staffeln", "black", "light_gray") .PHP_EOL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment