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
805cf24d
Commit
805cf24d
authored
Mar 09, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
da44637d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
37 deletions
+49
-37
media.class.php
media.class.php
+49
-37
No files found.
media.class.php
View file @
805cf24d
...
...
@@ -249,6 +249,7 @@ class Media {
echo
" Hole Daten von themoviedb.org... "
;
//TODO COVERDOWNLOAD und FANART für themovieDB
$tmdb
=
$this
->
jsonCacheDecoder
(
"https://api.themoviedb.org/3/find/tt"
.
$imdbID
.
"?external_source=imdb_id&api_key="
.
$this
->
config
[
"ApiKeys"
][
'Tmdb_Key'
]
.
"&language=de"
);
if
(
!
(
$tmdb
==
false
)){
if
(
isset
(
$tmdb
[
"movie_results"
])){
if
(
isset
(
$tmdb
[
"movie_results"
][
0
][
"overview"
])){
echo
" done!"
.
PHP_EOL
;
...
...
@@ -260,6 +261,7 @@ class Media {
$tmdbURL
=
"https://api.themoviedb.org/3/movie/"
.
$tmdb
[
"movie_results"
][
0
][
"id"
]
.
"?api_key="
.
$this
->
config
[
"ApiKeys"
][
'Tmdb_Key'
]
.
"&language=de&append_to_response=trailers"
;
//echo $tmdbURL;
$tmdbData1
=
$this
->
jsonCacheDecoder
(
$tmdbURL
);
if
(
!
(
$tmdbData
==
false
)){
if
(
isset
(
$tmdbData1
[
"title"
])){
$DataArray
[
"titelDeutsch"
]
=
$tmdbData1
[
"title"
];
}
if
(
isset
(
$tmdbData1
[
"original_title"
])){
$DataArray
[
"titelOriginal"
]
=
$tmdbData1
[
"original_title"
];}
if
(
isset
(
$tmdbData1
[
"tagline"
])){
$DataArray
[
"tagline"
]
=
$tmdbData1
[
"tagline"
];}
...
...
@@ -274,7 +276,7 @@ class Media {
}
}
else
{
$tmdbURL2
=
"https://api.themoviedb.org/3/mo
vie/"
.
$tmdb
[
"movie_results"
][
0
][
"id"
]
.
"?api_key="
.
$this
->
config
[
"ApiKeys"
][
'Tmdb_Key'
]
.
"&language=en&append_to_response=trailers"
;
$tmdbURL2
=
"https://api.themoviedb.org/3/moreturn true;return true;
vie/"
.
$tmdb
[
"movie_results"
][
0
][
"id"
]
.
"?api_key="
.
$this
->
config
[
"ApiKeys"
][
'Tmdb_Key'
]
.
"&language=en&append_to_response=trailers"
;
$tmdbData2
=
$this
->
jsonCacheDecoder
(
$tmdbURL2
);
if
(
isset
(
$tmdbData2
[
"trailers"
][
"youtube"
][
0
][
"source"
])){
$youtubeEN
=
str_replace
(
"&hd=1"
,
""
,
$tmdbData2
[
"trailers"
][
"youtube"
][
0
][
"source"
]);
...
...
@@ -289,10 +291,15 @@ class Media {
}
}
return
true
;
}
else
{
return
false
;}
}
else
{
echo
" fail1!"
.
PHP_EOL
;
return
false
;
}
}
else
{
return
false
;
}
}
/**
...
...
@@ -878,7 +885,12 @@ class Media {
}
$filename
=
md5
(
$url
)
.
".json"
;
//TODO Cachetime Ändern
if
(
!
file_exists
(
$CacheFolderName
.
$filename
)){
$Data
=
file_get_contents
(
$url
);
if
(
strlen
(
$Data
)
>
0
){
file_put_contents
(
$CacheFolderName
.
$filename
,
file_get_contents
(
$url
));
}
else
{
return
false
;
}
}
return
json_decode
(
file_get_contents
(
$CacheFolderName
.
$filename
),
true
);
}
...
...
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