mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-05 11:00:47 +02:00
Don't allow chapter URLs for multi-chapter stories on restrictedsection.org.
This commit is contained in:
parent
af01875d46
commit
8e6f23ab3f
1 changed files with 6 additions and 0 deletions
|
|
@ -93,6 +93,12 @@ class RestrictedSectionOrgSiteAdapter(BaseSiteAdapter):
|
|||
storya = soup.find('a',href=re.compile(r"^story.php\?story=\d+"))
|
||||
url = 'http://'+self.host+'/'+storya['href'].split('&')[0] # strip rs_session
|
||||
|
||||
fileas = soup.find('a',href=re.compile(r"^file.php\?file=\d+"))
|
||||
if fileas:
|
||||
for filea in fileas:
|
||||
if 'Previous Chapter' in filea.string or 'Next Chapter' in filea.string:
|
||||
raise exceptions.FailedToDownload(self.getSiteDomain() +" Cannot use chapter url with multi-chapter stories on this site.")
|
||||
|
||||
logger.debug("metadata URL: "+url)
|
||||
data = self._fetchUrl(url)
|
||||
# print data
|
||||
|
|
|
|||
Loading…
Reference in a new issue