mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
6ff633fc7a
commit
c999b12063
@ -50,7 +50,7 @@ def get_details(browser, url, timeout): # {{{
|
|||||||
if gc() != 403:
|
if gc() != 403:
|
||||||
raise
|
raise
|
||||||
# Google is throttling us, wait a little
|
# Google is throttling us, wait a little
|
||||||
time.sleep(1)
|
time.sleep(2)
|
||||||
raw = browser.open_novisit(url, timeout=timeout).read()
|
raw = browser.open_novisit(url, timeout=timeout).read()
|
||||||
|
|
||||||
return raw
|
return raw
|
||||||
|
@ -229,7 +229,11 @@ def rewrite_links(root, link_repl_func, resolve_base_href=False):
|
|||||||
if 'style' in el.attrib:
|
if 'style' in el.attrib:
|
||||||
text = el.attrib['style']
|
text = el.attrib['style']
|
||||||
if _css_url_re.search(text) is not None:
|
if _css_url_re.search(text) is not None:
|
||||||
stext = parseStyle(text)
|
try:
|
||||||
|
stext = parseStyle(text)
|
||||||
|
except:
|
||||||
|
# Parsing errors are raised by cssutils
|
||||||
|
continue
|
||||||
for p in stext.getProperties(all=True):
|
for p in stext.getProperties(all=True):
|
||||||
v = p.cssValue
|
v = p.cssValue
|
||||||
if v.CSS_VALUE_LIST == v.cssValueType:
|
if v.CSS_VALUE_LIST == v.cssValueType:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user