mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-10 11:40:24 +08:00
Fixed multiline ff.net
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user