1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 16:33:16 +01:00

Fix some images not having srcset and sizes removed

This commit is contained in:
David Lynch 2024-11-23 22:33:43 -06:00
parent 746ec1b994
commit d49d7891c3

View file

@ -297,11 +297,12 @@ class Site:
tag['style'] = re.sub(r'(?:color|background)\s*:[^;]+;?', '', tag['style'])
if base:
for img in contents.find_all('img', src=lambda src: not src.startswith('http')):
for img in contents.find_all('img', src=True):
# Later epub processing needs absolute image URLs
# print("fixing img src", img['src'], self._join_url(base, img['src']))
img['src'] = self._join_url(base, img['src'])
del img['srcset']
del img['sizes']
return contents