mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-05 02:51:48 +02:00
adapter_quotevcom: Additional chapter image parsing.
This commit is contained in:
parent
8c6c6991c2
commit
5680027b72
1 changed files with 13 additions and 2 deletions
|
|
@ -134,16 +134,27 @@ class QuotevComAdapter(BaseSiteAdapter):
|
|||
|
||||
def getChapterText(self, url):
|
||||
data = self.get_request(url)
|
||||
# logger.debug(data)
|
||||
soup = self.make_soup(data)
|
||||
|
||||
rescontent = soup.find('div', id='rescontent')
|
||||
|
||||
# attempt to find and include chapter specific images.
|
||||
img = soup.find('div',{'id':'quizHeader'}).find('img')
|
||||
#print("img['src'](%s) != self.coverurl(%s)"%(img['src'],self.coverurl))
|
||||
if img['src'] != self.coverurl:
|
||||
# don't include if same as cover or if hr.png placeholder
|
||||
if img['src'] != self.coverurl and not img['src'].endswith('/hr.png'):
|
||||
rescontent.insert(0,img)
|
||||
|
||||
# find and include JS hidden image.
|
||||
resultImage = soup.find('img',id='resultImage')
|
||||
if resultImage:
|
||||
onclick = resultImage['onclick']
|
||||
imgstr = onclick[onclick.index('<img'):onclick.index('>')+1].replace('\\','')
|
||||
# logger.debug(imgstr)
|
||||
imgsoup = self.make_soup(imgstr)
|
||||
# logger.debug(imgsoup)
|
||||
rescontent.insert(0,imgsoup.find('img').extract())
|
||||
|
||||
for a in rescontent('a'):
|
||||
a.unwrap()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue