diff --git a/sites/ao3.py b/sites/ao3.py index 910e0ee..3da001a 100644 --- a/sites/ao3.py +++ b/sites/ao3.py @@ -60,7 +60,7 @@ def _extract_work(self, workid): ) # Fetch the chapter list as well because it contains info that's not in the full work - nav_soup = self._soup(f'https://archiveofourown.org/works/{workid}/navigate') + nav_soup, nav_base = self._soup(f'https://archiveofourown.org/works/{workid}/navigate') chapters = soup.select('#chapters > div') if len(chapters) == 1: # in a single-chapter story the #chapters div is actually the chapter diff --git a/sites/fanfictionnet.py b/sites/fanfictionnet.py index 68fa6fc..c074fb5 100644 --- a/sites/fanfictionnet.py +++ b/sites/fanfictionnet.py @@ -107,7 +107,7 @@ def _soup(self, url, *args, **kwargs): self.session.cache.delete_url(fallback) raise CloudflareException("Couldn't fetch, presumably because of Cloudflare protection, and falling back to archive.org failed; if some chapters were succeeding, try again?", url, fallback) try: - super()._soup(self, url, *args, **kwargs) + return super()._soup(self, url, *args, **kwargs) except CloudflareException: self._cloudflared = True return self._soup(url, *args, **kwargs)