Fixed multiline ff.net

This commit is contained in:
sigizmund 2009-12-21 13:40:11 +00:00
parent 1740e0da48
commit 48d561de1a

View file

@ -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):