Fix #2049410 [A minor bug in source code src/calibre/web/feeds /news.py](https://bugs.launchpad.net/calibre/+bug/2049410)

This commit is contained in:
Kovid Goyal 2024-01-16 07:06:56 +05:30
parent 0fc78f89e0
commit 401c3b615f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1148,7 +1148,7 @@ class BasicNewsRecipe(Recipe):
if bn:
bn = bn.rpartition('/')[-1]
if bn:
img = os.path.join(imgdir, 'feed_image_%d%s'%(self.image_counter, os.path.splitext(bn)))
img = os.path.join(imgdir, 'feed_image_%d%s'%(self.image_counter, os.path.splitext(bn)[-1]))
try:
with open(img, 'wb') as fi, closing(self.browser.open(feed.image_url, timeout=self.timeout)) as r:
fi.write(r.read())