adapter_fictionmaniatv: Updates for site change

This commit is contained in:
Jim Miller 2025-04-09 09:46:22 -05:00
parent 44f5feacfb
commit 658b637716
3 changed files with 14 additions and 2 deletions

View file

@ -2076,7 +2076,9 @@ datePublished_format:%%Y-%%m-%%d %%H:%%M:%%S
[fictionmania.tv]
use_basic_cache:true
slow_down_sleep_time:10
website_encodings:ISO-8859-1,auto
user_agent:
## Extra metadata that this adapter knows about. See [archiveofourown.org]
## for examples of how to use them.

View file

@ -167,11 +167,19 @@ class FictionManiaTVAdapter(BaseSiteAdapter):
# <div style="margin-left:10ex;margin-right:10ex">
## fetching SWI version now instead of text.
htmlurl = url.replace('readtextstory','readhtmlstory')
soup = self.make_soup(self.get_request(htmlurl))
div = soup.find('div',style="margin-left:10ex;margin-right:10ex")
## Used to find by style, but it's inconsistent now. we've seen:
## margin-left:10ex;margin-right:10ex
## margin-right: 5%; margin-left: 5%
## margin-left:5%; margin-right:5%
## margin-left:5%; margin-right:5%; background: white
## but '<!--Read or display the file-->' appears to be consistent.
data = self.get_request(htmlurl)
soup = self.make_soup(data[data.index('<!--Read or display the file-->'):])
div = soup.find('div')
if div:
return self.utf8FromSoup(htmlurl,div)
else:
# logger.debug(soup)
logger.debug("Story With Images(SWI) not found, falling back to HTML.")
## fetching html version now instead of text.

View file

@ -2069,7 +2069,9 @@ datePublished_format:%%Y-%%m-%%d %%H:%%M:%%S
[fictionmania.tv]
use_basic_cache:true
slow_down_sleep_time:10
website_encodings:ISO-8859-1,auto
user_agent:
## Extra metadata that this adapter knows about. See [archiveofourown.org]
## for examples of how to use them.