mirror of https://gitlab.com/bashrc2/epicyon
Explicitly detect mime type
parent
ddd29d8577
commit
d5e9652b16
|
@ -153,7 +153,7 @@ def _downloadNewswireFeedFavicon(session, baseDir: str,
|
|||
timeoutSec = 10
|
||||
imageData, mimeType = \
|
||||
downloadImageAnyMimeType(session, favUrl, timeoutSec, debug)
|
||||
if not imageData:
|
||||
if not imageData or not mimeType:
|
||||
return False
|
||||
if 'image/png' in mimeType:
|
||||
favUrl = favUrl.replace('.ico', '.png')
|
||||
|
|
|
@ -458,7 +458,7 @@ def downloadImage(session, baseDir: str, url: str,
|
|||
def downloadImageAnyMimeType(session, url: str, timeoutSec: int, debug: bool):
|
||||
"""http GET for an image with any mime type
|
||||
"""
|
||||
mimeType = 'image/png'
|
||||
mimeType = None
|
||||
contentType = None
|
||||
result = None
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue