mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-10-30 12:50:24 +08:00
Fimfiction adapter: fixing img tag urls missing http:
This commit is contained in:
1 parent
eac7f4ed4a
commit
d7103969e7
1 file changed
+7
-1
@@ -304,5 +304,11 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
|
||||
soup = bs.BeautifulSoup(data,selfClosingTags=('br','hr')).find('div', {'class' : 'chapter_content'})
|
||||
if soup == None:
|
||||
raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)
|
||||
|
||||
# fix for img urls missing 'http:'
|
||||
images = soup.findAll('img')
|
||||
for imagetag in images:
|
||||
if (not imagetag['src'] is None) and (imagetag['src'].startswith('//')):
|
||||
imagetag['src'] = "http:"+imagetag['src']
|
||||
|
||||
return self.utf8FromSoup(url,soup)
|
||||
|
||||
Reference in new issue
Block a user