mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression in 0.8.34 that broke recipes that used skip_ad_pages() but not get_browser(). Fixes #923724 (Recipes and cookies)
This commit is contained in:
parent
e02648bd0c
commit
64265d0465
@ -545,8 +545,10 @@ class BasicNewsRecipe(Recipe):
|
|||||||
'''
|
'''
|
||||||
if re.match(r'\w+://', url_or_raw):
|
if re.match(r'\w+://', url_or_raw):
|
||||||
# We may be called in a thread (in the skip_ad_pages method), so
|
# We may be called in a thread (in the skip_ad_pages method), so
|
||||||
# clone the browser to be safe
|
# clone the browser to be safe. We cannot use self.cloned_browser
|
||||||
br = self.cloned_browser
|
# as it may or may not actually clone the browser, depending on if
|
||||||
|
# the recipe implements get_browser() or not
|
||||||
|
br = self.clone_browser(self.browser)
|
||||||
open_func = getattr(br, 'open_novisit', br.open)
|
open_func = getattr(br, 'open_novisit', br.open)
|
||||||
with closing(open_func(url_or_raw)) as f:
|
with closing(open_func(url_or_raw)) as f:
|
||||||
_raw = f.read()
|
_raw = f.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user