Enable pagecache for base_efiction.

This commit is contained in:
Jim Miller 2021-01-31 13:07:50 -06:00
parent e3217dfed6
commit 623158bb01
3 changed files with 5 additions and 3 deletions

View file

@ -554,6 +554,7 @@ internalize_text_links:true
use_pagecache:false
[base_efiction]
use_pagecache:true
## At the time of writing, eFiction Base adapters allow downloading
## the whole story in bulk using the 'Print' feature. If 'bulk_load'

View file

@ -207,7 +207,7 @@ class BaseEfictionAdapter(BaseSiteAdapter):
or getMessageThereIsNoSuchAccount in html \
or getMessageWrongPassword in html
def _fetch_to_soup(self, url):
def _fetch_to_soup(self, url, usecache=False):
"""
Fetch a HTML document, fix it and parse it to BeautifulSoup.
@ -215,7 +215,7 @@ class BaseEfictionAdapter(BaseSiteAdapter):
Makes image links absolute so they can be downloaded
"""
html = self.get_request(url)
html = self.get_request(url,usecache=usecache)
# Some site use old, old-school Comments <!- comment -> (single dash)
html = re.sub("<!-.+?->", "", html)
@ -374,7 +374,7 @@ class BaseEfictionAdapter(BaseSiteAdapter):
if self.getMessageRegisteredUsersOnly() in errorDiv.prettify():
if not self.triedLoggingIn:
self.performLogin(self.url)
soup = self._fetch_to_soup(printUrl)
soup = self._fetch_to_soup(printUrl,usecache=False)
errorDiv = soup.find("div", "errortext")
self.triedLoggingIn = True
else:

View file

@ -581,6 +581,7 @@ internalize_text_links:true
use_pagecache:false
[base_efiction]
use_pagecache:true
## At the time of writing, eFiction Base adapters allow downloading
## the whole story in bulk using the 'Print' feature. If 'bulk_load'