Abstract 'Back to index' in base_efiction for other languages.

This commit is contained in:
Jim Miller 2022-02-20 11:08:32 -06:00
parent 53c8b69f1e
commit 16be4cbbe5
2 changed files with 9 additions and 1 deletions

View file

@ -37,6 +37,10 @@ class MerengoHuAdapter(BaseEfictionAdapter):
def getDateFormat(self):
return "%Y.%m.%d"
@classmethod
def getBacktoIndex(self):
return 'Vissza az indexhez'
def extractChapterUrlsAndMetadata(self):
## merengo.hu has a custom 18 consent click through
self.get_request(self.getUrlForPhp('tizennyolc.php')+'?consent=true')

View file

@ -197,6 +197,10 @@ class BaseEfictionAdapter(BaseSiteAdapter):
"""
return _USERACCOUNT
@classmethod
def getBacktoIndex(self):
return 'Back to index'
## Login seems to be reasonably standard across eFiction sites.
@classmethod
def needToLoginCheck(self, html):
@ -459,7 +463,7 @@ class BaseEfictionAdapter(BaseSiteAdapter):
chapterId = m.group('chapterId')
chapterLink = b.findNext("a")
chapterLink['href'] = "%s&chapter=%s" % (self.url, chapterId)
if chapterLink.string !='Back to index':
if chapterLink.string != self.getBacktoIndex():
self.add_chapter(chapterLink.string, chapterLink['href'])
## Store reference to soup for getChapterText