update to new flickr metadata format
authorJan Szejko <janek37@gmail.com>
Mon, 18 Dec 2017 10:49:03 +0000 (11:49 +0100)
committerJan Szejko <janek37@gmail.com>
Mon, 18 Dec 2017 10:49:03 +0000 (11:49 +0100)
apps/cover/utils.py

index 80ee0b7..f1cdcc9 100755 (executable)
@@ -52,7 +52,7 @@ def get_flickr_data(url):
     m = re.search(r'modelExport: (\{.*\})', html)
     try:
         assert m
-        download_url = 'https:' + json.loads(m.group(1))['photo-models'][0]['sizes']['o']['url']
+        download_url = 'https:' + json.loads(m.group(1))['main']['photo-models'][0]['sizes']['o']['url']
     except (AssertionError, ValueError, IndexError, KeyError):
         raise FlickrError('Error reading image URL.')
     return {