From 5ca8ef00f04170f83e5d7423b02a9663af387bd6 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Sun, 28 Oct 2012 12:22:10 -0500 Subject: [PATCH] ncisfiction.com -> ncisfiction.net --- defaults.ini | 3 +-- fanficdownloader/adapters/__init__.py | 2 +- ...ictioncom.py => adapter_ncisfictionnet.py} | 21 +++++++++++++++---- plugin-defaults.ini | 10 ++++++++- 4 files changed, 28 insertions(+), 8 deletions(-) rename fanficdownloader/adapters/{adapter_ncisfictioncom.py => adapter_ncisfictionnet.py} (88%) diff --git a/defaults.ini b/defaults.ini index 50aba641..0e744051 100644 --- a/defaults.ini +++ b/defaults.ini @@ -1043,7 +1043,7 @@ extracategories:Queer as Folk ## cover image. This lets you exclude them. cover_exclusion_regexp:/stories/999/images/.*?_trophy.png -[www.ncisfiction.com] +[www.ncisfiction.net] ## Site dedicated to these categories/characters/ships extracategories:NCIS @@ -1238,4 +1238,3 @@ extracategories:Stargate: Atlantis ## extratags params in all other sections. Only commandline options ## beat overrides. #extratags:fanficdownloader - diff --git a/fanficdownloader/adapters/__init__.py b/fanficdownloader/adapters/__init__.py index ac3a3d07..ce589f44 100644 --- a/fanficdownloader/adapters/__init__.py +++ b/fanficdownloader/adapters/__init__.py @@ -75,7 +75,7 @@ import adapter_storiesofardacom import adapter_yourfanfictioncom import adapter_samdeanarchivenu import adapter_destinysgatewaycom -import adapter_ncisfictioncom +import adapter_ncisfictionnet import adapter_stargateatlantisorg import adapter_thealphagatecom import adapter_fanfiktionde diff --git a/fanficdownloader/adapters/adapter_ncisfictioncom.py b/fanficdownloader/adapters/adapter_ncisfictionnet.py similarity index 88% rename from fanficdownloader/adapters/adapter_ncisfictioncom.py rename to fanficdownloader/adapters/adapter_ncisfictionnet.py index fde27352..2f64fd94 100644 --- a/fanficdownloader/adapters/adapter_ncisfictioncom.py +++ b/fanficdownloader/adapters/adapter_ncisfictionnet.py @@ -28,15 +28,20 @@ from .. import exceptions as exceptions from base_adapter import BaseSiteAdapter, makeDate def getClass(): - return NCISFictionComAdapter + return NCISFictionNetAdapter # Class name has to be unique. Our convention is camel case the # sitename with Adapter at the end. www is skipped. -class NCISFictionComAdapter(BaseSiteAdapter): +class NCISFictionNetAdapter(BaseSiteAdapter): def __init__(self, config, url): BaseSiteAdapter.__init__(self, config, url) + # ncisfiction.net blocks IPs the default user-agent. However, + # when asked, they said it was just general anti-spam, not + # targeted at us. That lets me do this in good conscience: + self.opener.addheaders = [('User-agent', 'FFDL/1.6')] + self.decode = ["iso-8859-1", "Windows-1252"] # 1252 is a superset of iso-8859-1. # Most sites that claim to be @@ -64,13 +69,21 @@ class NCISFictionComAdapter(BaseSiteAdapter): @staticmethod # must be @staticmethod, don't remove it. def getSiteDomain(): # The site domain. Does have www here, if it uses it. - return 'www.ncisfiction.com' + return 'www.ncisfiction.net' + + ## Changed from www.ncisfiction.com to www.ncisfiction.net Oct + ## 2012 due to the ncisfiction.com domain expiring. Still accept + ## .com domains for existing updates, etc. + + @classmethod + def getAcceptDomains(cls): + return ['www.ncisfiction.net','www.ncisfiction.com'] def getSiteExampleURLs(self): return "http://"+self.getSiteDomain()+"/story.php?stid=01234 http://"+self.getSiteDomain()+"/chapters.php?stid=1234" def getSiteURLPattern(self): - return "http://"+self.getSiteDomain()+r'/(chapters|story)?.php\?stid=\d+' + return r'http://www\.ncisfiction\.(net|com)/(chapters|story)?.php\?stid=\d+' ## Getting the chapter list and the meta data, plus 'is adult' checking. diff --git a/plugin-defaults.ini b/plugin-defaults.ini index a4e5cafc..64e5c0e7 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -659,6 +659,10 @@ extracharacters:Hermione Granger ## Site dedicated to these categories/characters/ships extracategories:Highlander +[indeath.net] +## Site dedicated to these categories/characters/ships +extracategories:In Death + [ksarchive.com] ## Site dedicated to these categories/characters/ships extracategories:Star Trek @@ -999,6 +1003,10 @@ extraships:InuYasha/Kagome ## personal.ini, not defaults.ini. #is_adult:true +[www.jlaunlimited.com] +## Site dedicated to these categories/characters/ships +extracategories:JLA + [www.libraryofmoria.com] ## Site dedicated to these categories/characters/ships extracategories:Lord of the Rings @@ -1023,7 +1031,7 @@ extracategories:Queer as Folk ## cover image. This lets you exclude them. cover_exclusion_regexp:/stories/999/images/.*?_trophy.png -[www.ncisfiction.com] +[www.ncisfiction.net] ## Site dedicated to these categories/characters/ships extracategories:NCIS