mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-15 21:32:28 +01:00
Fixed multiline ff.net
This commit is contained in:
parent
1740e0da48
commit
48d561de1a
1 changed files with 16 additions and 2 deletions
18
ffnet.py
18
ffnet.py
|
|
@ -114,10 +114,24 @@ class FFNet(FanfictionSiteAdapter):
|
|||
def getText(self, url):
|
||||
data = self._fetchUrl(url)
|
||||
lines = data.split('\n')
|
||||
|
||||
textbuf = ''
|
||||
emit = False
|
||||
|
||||
for l in lines:
|
||||
if l.find('<!-- start story -->') != -1:
|
||||
s2 = bs.BeautifulStoneSoup(l)
|
||||
return s2.div.prettify()
|
||||
#s2 = bs.BeautifulStoneSoup(l)
|
||||
#return s2.div.prettify()
|
||||
emit = True
|
||||
|
||||
if emit:
|
||||
textbuf = textbuf + "\n" + l
|
||||
|
||||
if l.find('<!-- end story -->') != -1:
|
||||
emit = False
|
||||
|
||||
s2 = bs.BeautifulStoneSoup(textbuf)
|
||||
return s2.div.prettify()
|
||||
|
||||
|
||||
def setLogin(self, login):
|
||||
|
|
|
|||
Loading…
Reference in a new issue