diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py index 74727b9c..ee54efb2 100644 --- a/calibre-plugin/__init__.py +++ b/calibre-plugin/__init__.py @@ -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, 3) + version = (1, 5, 4) minimum_calibre_version = (0, 8, 30) #: This field defines the GUI plugin class that contains all the code diff --git a/downloader.py b/downloader.py index ab20bf2f..1552563c 100644 --- a/downloader.py +++ b/downloader.py @@ -63,7 +63,7 @@ def main(): help="Retrieve metadata and stop. Or, if --update-epub, update metadata title page only.",) parser.add_option("-u", "--update-epub", action="store_true", dest="update", - help="Update an existing epub with new chapter, give epub filename instead of storyurl. Not compatible with inserted TOC.",) + help="Update an existing epub with new chapter, give epub filename instead of storyurl.",) parser.add_option("--force", action="store_true", dest="force", help="Force overwrite or update of an existing epub, download and overwrite all chapters.",) diff --git a/fanficdownloader/adapters/adapter_fimfictionnet.py b/fanficdownloader/adapters/adapter_fimfictionnet.py index 207196e6..579189f8 100644 --- a/fanficdownloader/adapters/adapter_fimfictionnet.py +++ b/fanficdownloader/adapters/adapter_fimfictionnet.py @@ -83,9 +83,20 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter): if "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource" in data: raise exceptions.StoryDoesNotExist(self.url) + + if "/images/missing_story.png" in data: + raise exceptions.StoryDoesNotExist(self.url) if "This story has been marked as having adult content." in data: raise exceptions.AdultCheckRequired(self.url) + + if self.password: + params = {} + params['password'] = self.password + data = self._postUrl(self.url,params) + + if "Enter the password the author set for this story to view it." in data: + raise exceptions.FailedToLogin(self.url,"Story requires individual password") soup = bs.BeautifulSoup(data).find("div", {"class":"content_box post_content_box"}) @@ -161,7 +172,7 @@ class FimFictionNetSiteAdapter(BaseSiteAdapter): dateUpdated_soup.find('span').extract() dateUpdated = makeDate("%s%s"%(now.year,dateUpdated_soup.text), "%Y%b%d") if dateUpdated > now : - dateUpdated = datePublished.replace(year=now.year-1) + dateUpdated = dateUpdated.replace(year=now.year-1) self.story.setMetadata("dateUpdated", dateUpdated) # Get the date of creation from the first chapter