(2017-08-02, 18:28)movie78 Wrote: (2017-08-02, 12:25)JohnyBee Wrote: Hi Martijn,
Maybe a small mistake in the code:
File: default.py line 286
is:
Code:
currentmedia['id'] == '' and not
should
Code:
currentmedia['id'] == '' or not
Check it please.
Thanks for the great work
Just checked, still not working
Hi Movie78,
My code was a suggestion for Martijn.
Hmmm, ok full description:
1. You must have your active API_KEY from themoviedb.org (
API_KEY included in Artwork Downloader does not work).
- You login in to themoviedb.org and generate your API_KEY
A) Testing API_KEY from themoviedb:
- in Firefox
type:
Code:
http://api.themoviedb.org/3/movie/274857/images?api_key=Your_API_KEY
- you should get something like this:
Code:
{ "Id": 274857, "backdrops": [{ "ASPECT_RATIO aspect": 1.777777777777778 "FILE_PATH" "/ 22eFfWlar6MtXO5qG25TkjLphoj.jpg", "height" 1080 "iso_639_1": "en", "vote_average": 5318, "vote_count" 3 "width": 1920}, { "ASPECT_RATIO aspect": 1.777777777777778 "FILE_PATH" "/ 5GhvQpK4XO16NJVUPljK27KUQYp.jpg", "height" 2160 "iso_639_1": null "vote_average": 5318 " vote_count "3" width ": 3840}, {" ASPECT_RATIO aspect ": 1.777777777777778" FILE_PATH "" / rhs0spoLwcdF7ftXwBCHUVZQoQ4.jpg "," height "1080" iso_639_1 ":" en "," vote_average ": 5312, "vote_count" 1 "width": 1920} .....................
-
Your API_KEY is OK!
2. You must have your active Project_API_Key (
no Personal API Key!) with fanart.tv (
Project_API_Key included with Artwork Downloader does not work)
- You login in to fanart.tv and generate your Project_API_Key (
no Personal API Key!)
A) Testing Project_API_Key from fanart:
- in Firefox
type:
Code:
http://webservice.fanart.tv/v3/movies/274857?api_key=Your_Project_API_Key
- you should get something like this:
Code:
{
"Name": "King Arthur: Legend of the Sword",
"Tmdb_id": "274857",
"Imdb_id": "tt3496992",
"Movieposter": [
{
"Id": "191663",
"Url": "https://assets.fanart.tv/fanart/movies/274857/movieposter/king-arthur-legend-of-the-sword-58f73d8b51d4e.jpg",
"Lang": "00",
"Likes": "8"
}
{
"Id": "190897",
"Url": "https://assets.fanart.tv/fanart/movies/274857/movieposter/king-arthur-legend-of-the-sword-58ed50d0b9ec8.jpg",
"Lang": "00",
"Likes": "6"
}
{..............
-
Your Project_API_Key is OK!
3. Type your API_KEY = ... from themoviedb.org (line 33) in the addons\script.artwork.downloader\lib\provider\tmdb.py file.
4. Enter your (not Personal API Key!) API_KEY = ... with fanart.tv (line 34) in addons\script.artwork.downloader\lib\provider\fanart.py file
5. Modify the addons\script.artwork.downloader\default.py file:
Old code (lines 285-287):
PHP Code:
elif (currentmedia['mediatype'] == 'movie' and not
currentmedia['id'] == '' and not
currentmedia['id'].startswith('tt')):
New code:
PHP Code:
elif ((currentmedia['mediatype'] == 'movie') and (not currentmedia['id'] == '' or not currentmedia['id'].startswith('tt'))):
WARNING - python sensitive to blank characters
EDIT:
Now, "Artwork Downloader" can not cope with movies search by release date.
Modify the V:\addons\script.artwork.downloader\lib\provider\tmdb.py file:
old code:
PHP Code:
def _search_movie(medianame,year=''):
medianame = normalize_string(medianame)
log('TMDB API search criteria: Title[''%s''] | Year[''%s'']' % (medianame,year) )
illegal_char = ' -<>:"/\|?*%'
for char in illegal_char:
medianame = medianame.replace( char , '+' ).replace( '++', '+' ).replace( '+++', '+' )
search_url = 'http://api.themoviedb.org/3/search/movie?query=%s+%s&api_key=%s' %( medianame, year, API_KEY )
tmdb_id = ''
log('TMDB API search: %s ' % search_url)
try:
data = get_data(search_url, 'json')
if data == "Empty":
tmdb_id = ''
else:
for item in data['results']:
if item['id']:
tmdb_id = item['id']
break
except Exception, e:
log( str( e ), xbmc.LOGERROR )
if tmdb_id == '':
log('TMDB API search found no ID')
else:
log('TMDB API search found ID: %s' %tmdb_id)
return tmdb_id
new code:
PHP Code:
def _search_movie(medianame,year=''):
medianame = normalize_string(medianame)
log('TMDB API search criteria: Title[''%s''] | Year[''%s'']' % (medianame,year) )
illegal_char = ' -<>:"/\|?*%'
for char in illegal_char:
medianame = medianame.replace( char , '+' ).replace( '++', '+' ).replace( '+++', '+' )
# -JB-
# (I'm looking for the year) OR (I'm looking for the year-1) OR (I'm looking for the year+1)
for year_delta in [year, year-1,year+1]:
search_url = 'http://api.themoviedb.org/3/search/movie?query=%s&primary_release_year=%s&api_key=%s' % (medianame, year_delta, API_KEY)
tmdb_id = ''
log('TMDB API search: %s ' % search_url)
try:
data = get_data(search_url, 'json')
if data == "Empty":
tmdb_id = ''
else:
for item in data['results']:
if item['id']:
tmdb_id = item['id']
break
if tmdb_id != '':
break
except Exception, e:
log( str( e ), xbmc.LOGERROR )
if tmdb_id == '':
log('TMDB API search found no ID')
else:
log('TMDB API search found ID: %s' %tmdb_id)
return tmdb_id
For me Artwork Downloader works very well, Now
.