diff --git a/scrapinglib/fanza.py b/scrapinglib/fanza.py index 0ccf285..5ccd0b3 100644 --- a/scrapinglib/fanza.py +++ b/scrapinglib/fanza.py @@ -139,35 +139,24 @@ class Fanza(Parser): return result def getExtrafanart(self, htmltree): - html_parent = re.compile(r'
\s*?') - html = html_parent.search( - self.htmlcode) - if html: - html = html.group() - extrafanart_parent = re.compile(r'\s*?', self.htmlcode).group() + if htmltext: + extrafanart_images = re.findall(r'[\s\S].*}\s*?') - html = html_parent.search( - self.htmlcode) - if html: - html = html.group() - trailer_parent = re.compile(r'\"contentUrl\":\"(.*?)\"') - trailer_url = trailer_parent.search(html) - if trailer_url: - trailer_url = trailer_url.group(1) - trailer_cuts = trailer_url.rsplit('_', 2) - trailer_url = trailer_cuts[0] + '_mhb_w.mp4' - return trailer_url + htmltext = re.search(r'', self.htmlcode).group() + if htmltext: + url = re.search(r'\"contentUrl\":\"(.*?)\"', htmltext).group(1) + if url: + url = url.rsplit('_', 2)[0] + '_mhb_w.mp4' + return url return '' def getFanzaString(self, expr):