Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBPythonScripte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBPythonScripte
Commits
7490ad9e
Commit
7490ad9e
authored
Feb 25, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
4191cc09
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
5 deletions
+31
-5
media.class.php
media.class.php
+31
-5
No files found.
media.class.php
View file @
7490ad9e
...
...
@@ -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
){
//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
++
;
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment