Fix URLs with no content type header.

This commit is contained in:
Bastian Kleineidam 2013-03-07 23:08:37 +01:00
parent 1cc7d39047
commit 8259a01d64

View file

@ -53,7 +53,7 @@ class ComicImage(object):
self.urlobj = getImageObject(self.url, self.referrer, self.session)
except IOError as msg:
raise IOError('error retrieving URL %s: %s' % (self.url, msg))
content_type = unquote(self.urlobj.headers.get('content-type'))
content_type = unquote(self.urlobj.headers.get('content-type', 'application/octet-stream'))
content_type = content_type.split(';', 1)[0]
if '/' in content_type:
maintype, subtype = content_type.split('/', 1)