mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
News download: Handle URLs that have commas and non ascii characters correctly
This commit is contained in:
parent
5b4b130468
commit
e9254aa75a
@ -191,9 +191,9 @@ class RecursiveFetcher(object):
|
|||||||
if isinstance(url, unicode):
|
if isinstance(url, unicode):
|
||||||
url = url.encode('utf-8')
|
url = url.encode('utf-8')
|
||||||
# Not sure is this is really needed as I think mechanize
|
# Not sure is this is really needed as I think mechanize
|
||||||
# handles quoting automatically, but leaving it in
|
# handles quoting automatically, but leaving it
|
||||||
# in case it breaks something
|
# in case it breaks something
|
||||||
if re.search(r'\s+|,', url) is not None:
|
if re.search(r'\s+', url) is not None:
|
||||||
purl = list(urlparse.urlparse(url))
|
purl = list(urlparse.urlparse(url))
|
||||||
for i in range(2, 6):
|
for i in range(2, 6):
|
||||||
purl[i] = quote(purl[i])
|
purl[i] = quote(purl[i])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user