Fix for fimfiction.net 'too many values to unpack' error

This commit is contained in:
Jim Miller 2011-12-14 15:27:46 -06:00
parent 8905a08862
commit 63faea59d8

View file

@ -88,7 +88,8 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
soup = bs.BeautifulSoup(data).find("div", {"class":"content_box post_content_box"})
title, author = [link.text for link in soup.find("h2").findAll("a")]
title = soup.find("h2").find("a").text # first a link in first h2 is title.
author = soup.find("h2").find("span",{'class':'author'}).find("a").text
self.story.setMetadata("title", title)
self.story.setMetadata("author", author)
self.story.setMetadata("authorId", author) # The author's name will be unique
@ -158,4 +159,4 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter):
if soup == None:
raise exceptions.FailedToDownload("Error downloading Chapter: %s! Missing required element!" % url)
return utf8FromSoup(soup)