|
@ -10,11 +10,11 @@ import traceback |
|
|
log = CPLog(__name__) |
|
|
log = CPLog(__name__) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class IMDBAPI(MovieProvider): |
|
|
class OMDBAPI(MovieProvider): |
|
|
|
|
|
|
|
|
urls = { |
|
|
urls = { |
|
|
'search': 'http://www.imdbapi.com/?%s', |
|
|
'search': 'http://www.omdbapi.com/?%s', |
|
|
'info': 'http://www.imdbapi.com/?i=%s', |
|
|
'info': 'http://www.omdbapi.com/?i=%s', |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
http_time_between_calls = 0 |
|
|
http_time_between_calls = 0 |
|
@ -32,7 +32,7 @@ class IMDBAPI(MovieProvider): |
|
|
'name': q |
|
|
'name': q |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cache_key = 'imdbapi.cache.%s' % q |
|
|
cache_key = 'omdbapi.cache.%s' % q |
|
|
cached = self.getCache(cache_key, self.urls['search'] % tryUrlencode({'t': name_year.get('name'), 'y': name_year.get('year', '')}), timeout = 3) |
|
|
cached = self.getCache(cache_key, self.urls['search'] % tryUrlencode({'t': name_year.get('name'), 'y': name_year.get('year', '')}), timeout = 3) |
|
|
|
|
|
|
|
|
if cached: |
|
|
if cached: |
|
@ -50,7 +50,7 @@ class IMDBAPI(MovieProvider): |
|
|
if not identifier: |
|
|
if not identifier: |
|
|
return {} |
|
|
return {} |
|
|
|
|
|
|
|
|
cache_key = 'imdbapi.cache.%s' % identifier |
|
|
cache_key = 'omdbapi.cache.%s' % identifier |
|
|
cached = self.getCache(cache_key, self.urls['info'] % identifier, timeout = 3) |
|
|
cached = self.getCache(cache_key, self.urls['info'] % identifier, timeout = 3) |
|
|
|
|
|
|
|
|
if cached: |
|
|
if cached: |