mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1846 (Calibre can not download images with space in their name)
This commit is contained in:
parent
578cc310c2
commit
e60810d330
@ -7,6 +7,8 @@ granma.cubaweb.cu
|
|||||||
'''
|
'''
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class Granma(BasicNewsRecipe):
|
class Granma(BasicNewsRecipe):
|
||||||
title = 'Diario Granma'
|
title = 'Diario Granma'
|
||||||
__author__ = 'Darko Miletic'
|
__author__ = 'Darko Miletic'
|
||||||
|
@ -8,7 +8,7 @@ Fetch a webpage and its links recursively. The webpages are saved to disk in
|
|||||||
UTF-8 encoding with any charset declarations removed.
|
UTF-8 encoding with any charset declarations removed.
|
||||||
'''
|
'''
|
||||||
import sys, socket, os, urlparse, logging, re, time, copy, urllib2, threading, traceback
|
import sys, socket, os, urlparse, logging, re, time, copy, urllib2, threading, traceback
|
||||||
from urllib import url2pathname
|
from urllib import url2pathname, quote
|
||||||
from threading import RLock
|
from threading import RLock
|
||||||
from httplib import responses
|
from httplib import responses
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
@ -179,6 +179,8 @@ class RecursiveFetcher(object, LoggingInterface):
|
|||||||
delta = time.time() - self.last_fetch_at
|
delta = time.time() - self.last_fetch_at
|
||||||
if delta < self.delay:
|
if delta < self.delay:
|
||||||
time.sleep(delta)
|
time.sleep(delta)
|
||||||
|
if re.search(r'\s+', url) is not None:
|
||||||
|
url = quote(url)
|
||||||
with self.browser_lock:
|
with self.browser_lock:
|
||||||
try:
|
try:
|
||||||
with closing(self.browser.open(url)) as f:
|
with closing(self.browser.open(url)) as f:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user