only try to download if we have a url

This commit is contained in:
j 2019-02-01 16:43:55 +05:30
parent e623307d19
commit debe3823e2

View file

@ -843,9 +843,11 @@ def download_cover(id):
url = i.meta.get('cover') url = i.meta.get('cover')
else: else:
url = None url = None
cover = None
logger.debug('download cover %s %s', id, url) logger.debug('download cover %s %s', id, url)
ratio = None ratio = None
if url:
try: try:
cover = ox.net.read_url(url) cover = ox.net.read_url(url)
ratio = get_ratio(cover) ratio = get_ratio(cover)