summaryrefslogtreecommitdiff
path: root/imdb-lookup
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2014-12-11 00:30:18 +0100
committerYves Fischer <yvesf-git@xapek.org>2014-12-11 00:30:18 +0100
commitb11630e1afc7ef2350756b466a768d005eace03c (patch)
tree56619904e60983e3d5525ed6c67445b707a0ec1f /imdb-lookup
parent74023a791c04c121781018c807c8f2ee1d1d2baf (diff)
downloadscripts-b11630e1afc7ef2350756b466a768d005eace03c.tar.gz
scripts-b11630e1afc7ef2350756b466a768d005eace03c.zip
change poster key
Diffstat (limited to 'imdb-lookup')
-rwxr-xr-ximdb-lookup/imdbinfo.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py
index 15c19bd..1fe9aa7 100755
--- a/imdb-lookup/imdbinfo.py
+++ b/imdb-lookup/imdbinfo.py
@@ -9,6 +9,7 @@ import dbm
import json
import time
import base64
+import md5
import argparse
import math
import logging
@@ -111,8 +112,8 @@ class TMDBCache(object):
def poster(self, poster_path, f="w185"):
self.logger.debug("poster %s", poster_path)
- key = "poster_{}_{}".format(f, poster_path)
- keyContentType = "poster_{}_{}_content_type".format(f, poster_path)
+ key = "poster_{}_{}".format(f, md5.md5(poster_path).hexdigest()[0:10])
+ keyContentType = "{}_ct".format(key)
url = "http://image.tmdb.org/t/p/{}/{}".format(f, poster_path)
if key not in self.db_images:
r = requests.get(url)