SpiffyTitles: Fetch Rotten Tomatoes data for IMDB handler
Also add alternative IMDB template as config comment
This commit is contained in:
parent
e21690272e
commit
eebfdefeb5
|
|
@ -41,6 +41,9 @@ conf.registerGlobalValue(SpiffyTitles, 'language',
|
|||
conf.registerGlobalValue(SpiffyTitles, 'imdbTemplate',
|
||||
registry.String("^ {{Title}} ({{Year}}, {{Country}}) - Rating: {{imdbRating}} :: {{Plot}}", _("""Uses http://www.omdbapi.com to provide additional information about IMDB links""")))
|
||||
|
||||
# alternative template:
|
||||
# ^ {{Title}} ({{Year}} - {{Director}}) :: [i:{{imdbRating}} r:{{tomatoMeter}} m:{{Metascore}}] {{Plot}}
|
||||
|
||||
conf.registerGlobalValue(SpiffyTitles, 'coubTemplate',
|
||||
registry.String("^ {%if not_safe_for_work %}NSFW{% endif %} [{{channel.title}}] {{title}} :: {{views_count}} views :: {{likes_count}} likes :: {{recoubs_count}} recoubs", _("""Uses Coub API to get additional information about coub.com links""")))
|
||||
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ class SpiffyTitles(callbacks.Plugin):
|
|||
# We can only accommodate a specific format of URL here
|
||||
if "/title/" in url:
|
||||
imdb_id = url.split("/title/")[1].rstrip("/")
|
||||
omdb_url = "http://www.omdbapi.com/?i=%s&plot=short&r=json" % (imdb_id)
|
||||
omdb_url = "http://www.omdbapi.com/?i=%s&plot=short&r=json&tomatoes=true" % (imdb_id)
|
||||
|
||||
try:
|
||||
request = requests.get(omdb_url, timeout=10, headers=headers)
|
||||
|
|
|
|||
Loading…
Reference in New Issue