Add cover image to fanfiction.net, but default 'never_make_cover: true' for ffnet.

This commit is contained in:
Jim Miller 2012-06-14 19:07:49 -05:00
parent 642535fd8d
commit 33e2a4766e
4 changed files with 12 additions and 1 deletions

View file

@ -27,7 +27,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase):
description = 'UI plugin to download FanFiction stories from various sites.'
supported_platforms = ['windows', 'osx', 'linux']
author = 'Jim Miller'
version = (1, 5, 32)
version = (1, 5, 33)
minimum_calibre_version = (0, 8, 30)
#: This field defines the GUI plugin class that contains all the code

View file

@ -464,6 +464,9 @@ cover_exclusion_regexp:/images/.*?ribbon.gif
[www.dokuga.com]
[www.fanfiction.net]
## fanfiction.net's 'cover' images are really just tiny thumbnails.
## Comment this out or change it to false to use them anyway.
never_make_cover: true
[www.ficbook.net]

View file

@ -242,6 +242,11 @@ class FanFictionNetSiteAdapter(BaseSiteAdapter):
self.story.setMetadata('status', 'Completed')
else:
self.story.setMetadata('status', 'In-Progress')
img = soup.find('img',{'class':'cimage'})
if img:
self.story.addImgUrl(self,url,img['src'],self._fetchUrlRaw,cover=True)
return
def getChapterText(self, url):

View file

@ -449,6 +449,9 @@ cover_exclusion_regexp:/images/.*?ribbon.gif
[www.dokuga.com]
[www.fanfiction.net]
## fanfiction.net's 'cover' images are really just tiny thumbnails.
## Comment this out or change it to false to use them anyway.
never_make_cover: true
[www.ficbook.net]