mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-02-14 03:22:30 +01:00
Fimfiction adapter: fixing img tag urls missing http:
This commit is contained in:
parent
eac7f4ed4a
commit
d7103969e7
1 changed files with 7 additions and 1 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue