diff --git a/calibre-plugin/plugin-defaults.ini b/calibre-plugin/plugin-defaults.ini index 97e3bf8e..6909b5b6 100644 --- a/calibre-plugin/plugin-defaults.ini +++ b/calibre-plugin/plugin-defaults.ini @@ -2344,7 +2344,7 @@ datePublished_format:%%Y-%%m-%%d %%H:%%M:%%S ## cover image. This lets you exclude them. cover_exclusion_regexp:/img/rss.png -[www.midnightwhispers.ca] +[www.midnightwhispers.net] ## Some sites do not require a login, but do require the user to ## confirm they are adult for adult content. In commandline version, ## this should go in your personal.ini, not defaults.ini. diff --git a/fanficfare/adapters/__init__.py b/fanficfare/adapters/__init__.py index a91f83df..a187012a 100644 --- a/fanficfare/adapters/__init__.py +++ b/fanficfare/adapters/__init__.py @@ -49,7 +49,7 @@ import adapter_portkeyorg import adapter_mugglenetcom import adapter_hpfandomnet import adapter_nfacommunitycom -import adapter_midnightwhispersca +import adapter_midnightwhispers import adapter_ksarchivecom import adapter_archiveskyehawkecom import adapter_squidgeorgpeja diff --git a/fanficfare/adapters/adapter_midnightwhispersca.py b/fanficfare/adapters/adapter_midnightwhispers.py similarity index 95% rename from fanficfare/adapters/adapter_midnightwhispersca.py rename to fanficfare/adapters/adapter_midnightwhispers.py index d4ec00c0..2cbf6a83 100644 --- a/fanficfare/adapters/adapter_midnightwhispersca.py +++ b/fanficfare/adapters/adapter_midnightwhispers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2011 Fanficdownloader team, 2015 FanFicFare team +# Copyright 2011 Fanficdownloader team, 2017 FanFicFare team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -35,11 +35,11 @@ from base_adapter import BaseSiteAdapter, makeDate # updated to reflect the class below it. That, plus getSiteDomain() # take care of 'Registering'. def getClass(): - return MidnightwhispersCaAdapter # XXX + return MidnightwhispersAdapter # XXX # Class name has to be unique. Our convention is camel case the # sitename with Adapter at the end. www is skipped. -class MidnightwhispersCaAdapter(BaseSiteAdapter): # XXX +class MidnightwhispersAdapter(BaseSiteAdapter): # XXX def __init__(self, config, url): BaseSiteAdapter.__init__(self, config, url) @@ -69,14 +69,23 @@ class MidnightwhispersCaAdapter(BaseSiteAdapter): # XXX @staticmethod # must be @staticmethod, don't remove it. def getSiteDomain(): # The site domain. Does have www here, if it uses it. - return 'www.midnightwhispers.ca' # XXX + return 'www.midnightwhispers.net' # XXX + + @classmethod + def getAcceptDomains(cls): + return ['www.midnightwhispers.net','www.midnightwhispers.ca'] + + @classmethod + def getConfigSections(cls): + "Only needs to be overriden if has additional ini sections." + return ['www.midnightwhispers.ca',cls.getSiteDomain()] @classmethod def getSiteExampleURLs(cls): return "http://"+cls.getSiteDomain()+"/viewstory.php?sid=1234" def getSiteURLPattern(self): - return re.escape("http://"+self.getSiteDomain()+"/viewstory.php?sid=")+r"\d+$" + return re.escape("http://www.midnightwhispers.")+r"(ca|net)"+re.escape("/viewstory.php?sid=")+r"\d+$" ## Getting the chapter list and the meta data, plus 'is adult' checking. def extractChapterUrlsAndMetadata(self): diff --git a/fanficfare/defaults.ini b/fanficfare/defaults.ini index 56da662e..ad35230d 100644 --- a/fanficfare/defaults.ini +++ b/fanficfare/defaults.ini @@ -2356,7 +2356,7 @@ datePublished_format:%%Y-%%m-%%d %%H:%%M:%%S ## cover image. This lets you exclude them. cover_exclusion_regexp:/img/rss.png -[www.midnightwhispers.ca] +[www.midnightwhispers.net] ## Some sites do not require a login, but do require the user to ## confirm they are adult for adult content. In commandline version, ## this should go in your personal.ini, not defaults.ini.