mirror of https://gitlab.com/bashrc2/epicyon
Sequence
parent
5b4a3caa4a
commit
ca11153a36
|
|
@ -153,14 +153,14 @@ def _downloadNewswireFeedFavicon(session, baseDir: str,
|
||||||
timeoutSec = 10
|
timeoutSec = 10
|
||||||
imageData, mimeType = \
|
imageData, mimeType = \
|
||||||
getImageBinaryFromUrl(session, favUrl, timeoutSec, debug)
|
getImageBinaryFromUrl(session, favUrl, timeoutSec, debug)
|
||||||
|
if not imageData:
|
||||||
|
return False
|
||||||
if 'image/png' in mimeType:
|
if 'image/png' in mimeType:
|
||||||
favUrl = favUrl.replace('.ico', '.png')
|
favUrl = favUrl.replace('.ico', '.png')
|
||||||
elif 'image/webp' in mimeType:
|
elif 'image/webp' in mimeType:
|
||||||
favUrl = favUrl.replace('.ico', '.webp')
|
favUrl = favUrl.replace('.ico', '.webp')
|
||||||
elif 'image/gif' in mimeType:
|
elif 'image/gif' in mimeType:
|
||||||
favUrl = favUrl.replace('.ico', '.gif')
|
favUrl = favUrl.replace('.ico', '.gif')
|
||||||
if not imageData:
|
|
||||||
return False
|
|
||||||
if not os.path.isdir(baseDir + '/favicons'):
|
if not os.path.isdir(baseDir + '/favicons'):
|
||||||
os.mkdir(baseDir + '/favicons')
|
os.mkdir(baseDir + '/favicons')
|
||||||
linkFilename = favUrl.replace('/', '-')
|
linkFilename = favUrl.replace('/', '-')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue