mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-24 01:33:39 +01:00
Add support for 'This story has not been validated' in base_efiction_adapter
This commit is contained in:
parent
df836412cc
commit
b5cc612f96
1 changed files with 4 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ _WRONGPASSWORD = "That password doesn't match the one in our database"
|
|||
_USERACCOUNT = 'Member Account'
|
||||
|
||||
# Regular expressions
|
||||
_REGEX_WARING_PARAM = re.compile("warning=(?P<warningId>\d+)")
|
||||
_REGEX_WARNING_PARAM = re.compile("warning=(?P<warningId>\d+)")
|
||||
_REGEX_CHAPTER_B = re.compile("^(?P<chapterId>\d+)\.")
|
||||
_REGEX_CHAPTER_PARAM = re.compile("chapter=(?P<chapterId>\d+)$")
|
||||
_REGEX_CHAPTER_FRAGMENT = re.compile("^#(?P<chapterId>\d+)$")
|
||||
|
|
@ -345,6 +345,8 @@ class BaseEfictionAdapter(BaseSiteAdapter):
|
|||
self.triedLoggingIn = True
|
||||
else:
|
||||
raise exceptions.FailedToLogin(self.url, unicode(errorDiv))
|
||||
elif "This story has not been validated" in stripHTML(errorDiv):
|
||||
raise exceptions.AccessDenied(self.getSiteDomain() +" says: "+stripHTML(errorDiv))
|
||||
else:
|
||||
warningLink = errorDiv.find("a")
|
||||
if warningLink is not None and ( \
|
||||
|
|
@ -354,7 +356,7 @@ class BaseEfictionAdapter(BaseSiteAdapter):
|
|||
if not (self.is_adult or self.getConfig("is_adult")):
|
||||
raise exceptions.AdultCheckRequired(self.url)
|
||||
# XXX Using this method, we're independent of # getHighestWarningLevel
|
||||
printUrl += "&ageconsent=ok&warning=%s" % (_REGEX_WARING_PARAM.search(warningLink['href']).group(1))
|
||||
printUrl += "&ageconsent=ok&warning=%s" % (_REGEX_WARNING_PARAM.search(warningLink['href']).group(1))
|
||||
# printUrl += "&ageconsent=ok&warning=%s" % self.getHighestWarningLevel()
|
||||
soup = self._fetch_to_soup(printUrl)
|
||||
errorDiv = soup.find("div", "errortext")
|
||||
|
|
|
|||
Loading…
Reference in a new issue