From d64119484b1c350782fce2e0abe4cf89d7366452 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 8 Feb 2010 09:14:17 -0700 Subject: [PATCH] News download: Fix handling of images with an ampersand in their URLs --- src/calibre/web/fetch/simple.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index f97382190d..fc87e7fdcd 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -305,8 +305,6 @@ class RecursiveFetcher(object): iurl = tag['src'] if callable(self.image_url_processor): iurl = self.image_url_processor(baseurl, iurl) - ext = os.path.splitext(iurl)[1] - ext = ext[:5] if not urlparse.urlsplit(iurl).scheme: iurl = urlparse.urljoin(baseurl, iurl, False) with self.imagemap_lock: @@ -319,7 +317,7 @@ class RecursiveFetcher(object): self.log.exception('Could not fetch image %s'% iurl) continue c += 1 - fname = ascii_filename('img'+str(c)+ext) + fname = ascii_filename('img'+str(c)) if isinstance(fname, unicode): fname = fname.encode('ascii', 'replace') imgpath = os.path.join(diskpath, fname+'.jpg')