mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-08 12:36:11 +02:00
Take image .ext from end of whole URL if not found at end of path. Taking from content-type on response would be difficult.
This commit is contained in:
parent
e6ca5da2c9
commit
622f4d7dd1
1 changed files with 7 additions and 3 deletions
|
|
@ -149,9 +149,13 @@ def no_convert_image(url,data):
|
|||
ext=parsedUrl.path[parsedUrl.path.rfind('.')+1:].lower()
|
||||
|
||||
if ext not in imagetypes:
|
||||
logger.debug("no_convert_image url:%s - no known extension"%url)
|
||||
# doesn't have extension? use jpg.
|
||||
ext='jpg'
|
||||
# not found at end of path, try end of whole URL in case of
|
||||
# parameter.
|
||||
ext = url[url.rfind('.')+1:].lower()
|
||||
if ext not in imagetypes:
|
||||
logger.debug("no_convert_image url:%s - no known extension"%url)
|
||||
# doesn't have extension? use jpg.
|
||||
ext='jpg'
|
||||
|
||||
return (data,ext,imagetypes[ext])
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue