diff --git a/fanficfare/adapters/adapter_ashwindersycophanthexcom.py b/fanficfare/adapters/adapter_ashwindersycophanthexcom.py index d44af57..bcdb4fc 100644 --- a/fanficfare/adapters/adapter_ashwindersycophanthexcom.py +++ b/fanficfare/adapters/adapter_ashwindersycophanthexcom.py @@ -131,7 +131,7 @@ class AshwinderSycophantHexComAdapter(BaseSiteAdapter): data = self._fetchUrl(url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_asr3slashzoneorg.py b/fanficfare/adapters/adapter_asr3slashzoneorg.py index 1d69f10..4a6920d 100644 --- a/fanficfare/adapters/adapter_asr3slashzoneorg.py +++ b/fanficfare/adapters/adapter_asr3slashzoneorg.py @@ -119,7 +119,7 @@ class Asr3SlashzoneOrgAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_bloodtiesfancom.py b/fanficfare/adapters/adapter_bloodtiesfancom.py index 76ae5d4..3f266ae 100644 --- a/fanficfare/adapters/adapter_bloodtiesfancom.py +++ b/fanficfare/adapters/adapter_bloodtiesfancom.py @@ -198,7 +198,7 @@ class BloodTiesFansComAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_chaossycophanthexcom.py b/fanficfare/adapters/adapter_chaossycophanthexcom.py index c71da07..35b2916 100644 --- a/fanficfare/adapters/adapter_chaossycophanthexcom.py +++ b/fanficfare/adapters/adapter_chaossycophanthexcom.py @@ -106,7 +106,7 @@ class ChaosSycophantHexComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_csiforensicscom.py b/fanficfare/adapters/adapter_csiforensicscom.py index 7b4f518..c4924f9 100644 --- a/fanficfare/adapters/adapter_csiforensicscom.py +++ b/fanficfare/adapters/adapter_csiforensicscom.py @@ -105,7 +105,7 @@ class CSIForensicsComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_destinysgatewaycom.py b/fanficfare/adapters/adapter_destinysgatewaycom.py index ac498e9..e45150a 100644 --- a/fanficfare/adapters/adapter_destinysgatewaycom.py +++ b/fanficfare/adapters/adapter_destinysgatewaycom.py @@ -122,7 +122,7 @@ class DestinysGatewayComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_dokugacom.py b/fanficfare/adapters/adapter_dokugacom.py index 8b06d1e..14b36f0 100644 --- a/fanficfare/adapters/adapter_dokugacom.py +++ b/fanficfare/adapters/adapter_dokugacom.py @@ -147,7 +147,7 @@ class DokugaComAdapter(BaseSiteAdapter): soup = self.make_soup(data) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # print data # Now go hunting for all the meta data and the chapter list. diff --git a/fanficfare/adapters/adapter_dracoandginnycom.py b/fanficfare/adapters/adapter_dracoandginnycom.py index 7be9929..6f63f30 100644 --- a/fanficfare/adapters/adapter_dracoandginnycom.py +++ b/fanficfare/adapters/adapter_dracoandginnycom.py @@ -161,7 +161,7 @@ class DracoAndGinnyComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_dramioneorg.py b/fanficfare/adapters/adapter_dramioneorg.py index 5df53cc..dd08c96 100644 --- a/fanficfare/adapters/adapter_dramioneorg.py +++ b/fanficfare/adapters/adapter_dramioneorg.py @@ -146,7 +146,7 @@ class DramioneOrgAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_efictionestelielde.py b/fanficfare/adapters/adapter_efictionestelielde.py index 5c8c8b2..7a81cdb 100644 --- a/fanficfare/adapters/adapter_efictionestelielde.py +++ b/fanficfare/adapters/adapter_efictionestelielde.py @@ -91,7 +91,7 @@ class EfictionEstelielDeAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # Now go hunting for all the meta data and the chapter list. diff --git a/fanficfare/adapters/adapter_efpfanficnet.py b/fanficfare/adapters/adapter_efpfanficnet.py index 21dcb47..49d84c0 100644 --- a/fanficfare/adapters/adapter_efpfanficnet.py +++ b/fanficfare/adapters/adapter_efpfanficnet.py @@ -127,7 +127,7 @@ class EFPFanFicNet(BaseSiteAdapter): data = self._fetchUrl(url) # if "Access denied. This story has not been validated by the adminstrators of this site." in data: - # raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + # raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_erosnsapphosycophanthexcom.py b/fanficfare/adapters/adapter_erosnsapphosycophanthexcom.py index 59c908d..6558ab7 100644 --- a/fanficfare/adapters/adapter_erosnsapphosycophanthexcom.py +++ b/fanficfare/adapters/adapter_erosnsapphosycophanthexcom.py @@ -122,7 +122,7 @@ class ErosnSapphoSycophantHexComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_fanficcastletvnet.py b/fanficfare/adapters/adapter_fanficcastletvnet.py index a554a87..58316a6 100644 --- a/fanficfare/adapters/adapter_fanficcastletvnet.py +++ b/fanficfare/adapters/adapter_fanficcastletvnet.py @@ -177,7 +177,7 @@ class FanficCastleTVNetAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_fanfictionjunkiesde.py b/fanficfare/adapters/adapter_fanfictionjunkiesde.py index 3e7faef..728daf0 100644 --- a/fanficfare/adapters/adapter_fanfictionjunkiesde.py +++ b/fanficfare/adapters/adapter_fanfictionjunkiesde.py @@ -170,7 +170,7 @@ class FanfictionJunkiesDeAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_finestoriescom.py b/fanficfare/adapters/adapter_finestoriescom.py index 6a4dada..fbb01f9 100644 --- a/fanficfare/adapters/adapter_finestoriescom.py +++ b/fanficfare/adapters/adapter_finestoriescom.py @@ -126,7 +126,7 @@ class FineStoriesComAdapter(BaseSiteAdapter): data = self._fetchUrl(url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_grangerenchantedcom.py b/fanficfare/adapters/adapter_grangerenchantedcom.py index c44e0b5..35b67e3 100644 --- a/fanficfare/adapters/adapter_grangerenchantedcom.py +++ b/fanficfare/adapters/adapter_grangerenchantedcom.py @@ -173,7 +173,7 @@ class GrangerEnchantedCom(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_harrypotterfanfictioncom.py b/fanficfare/adapters/adapter_harrypotterfanfictioncom.py index 0268612..23bacb5 100644 --- a/fanficfare/adapters/adapter_harrypotterfanfictioncom.py +++ b/fanficfare/adapters/adapter_harrypotterfanfictioncom.py @@ -86,7 +86,7 @@ class HarryPotterFanFictionComSiteAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_hlfictionnet.py b/fanficfare/adapters/adapter_hlfictionnet.py index 9ce4c8d..5f10a4f 100644 --- a/fanficfare/adapters/adapter_hlfictionnet.py +++ b/fanficfare/adapters/adapter_hlfictionnet.py @@ -90,7 +90,7 @@ class HLFictionNetAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_hpfanficarchivecom.py b/fanficfare/adapters/adapter_hpfanficarchivecom.py index 38d205d..82b6a4f 100644 --- a/fanficfare/adapters/adapter_hpfanficarchivecom.py +++ b/fanficfare/adapters/adapter_hpfanficarchivecom.py @@ -91,7 +91,7 @@ class HPFanficArchiveComAdapter(BaseSiteAdapter): if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_iketernalnet.py b/fanficfare/adapters/adapter_iketernalnet.py index 1a103b3..b57cd13 100644 --- a/fanficfare/adapters/adapter_iketernalnet.py +++ b/fanficfare/adapters/adapter_iketernalnet.py @@ -173,7 +173,7 @@ class IkEternalNetAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_imagineeficcom.py b/fanficfare/adapters/adapter_imagineeficcom.py index 8b01c47..4f696bf 100644 --- a/fanficfare/adapters/adapter_imagineeficcom.py +++ b/fanficfare/adapters/adapter_imagineeficcom.py @@ -161,7 +161,7 @@ class ImagineEFicComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_ksarchivecom.py b/fanficfare/adapters/adapter_ksarchivecom.py index a8a37a4..a3c83e3 100644 --- a/fanficfare/adapters/adapter_ksarchivecom.py +++ b/fanficfare/adapters/adapter_ksarchivecom.py @@ -148,7 +148,7 @@ class KSArchiveComAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_lumossycophanthexcom.py b/fanficfare/adapters/adapter_lumossycophanthexcom.py index a6874cd..3dcf6f6 100644 --- a/fanficfare/adapters/adapter_lumossycophanthexcom.py +++ b/fanficfare/adapters/adapter_lumossycophanthexcom.py @@ -106,7 +106,7 @@ class LumosSycophantHexComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_merlinficdtwinscouk.py b/fanficfare/adapters/adapter_merlinficdtwinscouk.py index b0ea673..6c93101 100644 --- a/fanficfare/adapters/adapter_merlinficdtwinscouk.py +++ b/fanficfare/adapters/adapter_merlinficdtwinscouk.py @@ -161,7 +161,7 @@ class MerlinFicDtwinsCoUk(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_midnightwhispersca.py b/fanficfare/adapters/adapter_midnightwhispersca.py index 95e9845..d4ec00c 100644 --- a/fanficfare/adapters/adapter_midnightwhispersca.py +++ b/fanficfare/adapters/adapter_midnightwhispersca.py @@ -144,7 +144,7 @@ class MidnightwhispersCaAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_mugglenetcom.py b/fanficfare/adapters/adapter_mugglenetcom.py index 6acf147..21d887c 100644 --- a/fanficfare/adapters/adapter_mugglenetcom.py +++ b/fanficfare/adapters/adapter_mugglenetcom.py @@ -184,7 +184,7 @@ class MuggleNetComAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_nationallibrarynet.py b/fanficfare/adapters/adapter_nationallibrarynet.py index 7a2c577..7a0a03c 100644 --- a/fanficfare/adapters/adapter_nationallibrarynet.py +++ b/fanficfare/adapters/adapter_nationallibrarynet.py @@ -95,7 +95,7 @@ class NationalLibraryNetAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_ncisficcom.py b/fanficfare/adapters/adapter_ncisficcom.py index 90e4377..c3f7fb7 100644 --- a/fanficfare/adapters/adapter_ncisficcom.py +++ b/fanficfare/adapters/adapter_ncisficcom.py @@ -94,7 +94,7 @@ class NCISFicComAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_ncisfictionnet.py b/fanficfare/adapters/adapter_ncisfictionnet.py index 97116bf..ca59cd9 100644 --- a/fanficfare/adapters/adapter_ncisfictionnet.py +++ b/fanficfare/adapters/adapter_ncisfictionnet.py @@ -100,7 +100,7 @@ class NCISFictionNetAdapter(BaseSiteAdapter): if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_nfacommunitycom.py b/fanficfare/adapters/adapter_nfacommunitycom.py index b414ade..478e1c6 100644 --- a/fanficfare/adapters/adapter_nfacommunitycom.py +++ b/fanficfare/adapters/adapter_nfacommunitycom.py @@ -148,7 +148,7 @@ class NfaCommunityComAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_nickandgregnet.py b/fanficfare/adapters/adapter_nickandgregnet.py index ca2aa5d..ffec118 100644 --- a/fanficfare/adapters/adapter_nickandgregnet.py +++ b/fanficfare/adapters/adapter_nickandgregnet.py @@ -96,7 +96,7 @@ class NickAndGregNetAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_occlumencysycophanthexcom.py b/fanficfare/adapters/adapter_occlumencysycophanthexcom.py index 67e2d58..502efe6 100644 --- a/fanficfare/adapters/adapter_occlumencysycophanthexcom.py +++ b/fanficfare/adapters/adapter_occlumencysycophanthexcom.py @@ -131,7 +131,7 @@ class OcclumencySycophantHexComAdapter(BaseSiteAdapter): data = self._fetchUrl(url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_onedirectionfanfictioncom.py b/fanficfare/adapters/adapter_onedirectionfanfictioncom.py index 5550641..c9450c3 100644 --- a/fanficfare/adapters/adapter_onedirectionfanfictioncom.py +++ b/fanficfare/adapters/adapter_onedirectionfanfictioncom.py @@ -150,7 +150,7 @@ class OneDirectionFanfictionComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_pommedesangcom.py b/fanficfare/adapters/adapter_pommedesangcom.py index dff910a..f3af208 100644 --- a/fanficfare/adapters/adapter_pommedesangcom.py +++ b/fanficfare/adapters/adapter_pommedesangcom.py @@ -171,7 +171,7 @@ class PommeDeSangComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_ponyfictionarchivenet.py b/fanficfare/adapters/adapter_ponyfictionarchivenet.py index bc7219b..72d35d7 100644 --- a/fanficfare/adapters/adapter_ponyfictionarchivenet.py +++ b/fanficfare/adapters/adapter_ponyfictionarchivenet.py @@ -127,7 +127,7 @@ class PonyFictionArchiveNetAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_potionsandsnitches.py b/fanficfare/adapters/adapter_potionsandsnitches.py index d13511d..d69bf9d 100644 --- a/fanficfare/adapters/adapter_potionsandsnitches.py +++ b/fanficfare/adapters/adapter_potionsandsnitches.py @@ -77,7 +77,7 @@ class PotionsAndSnitchesOrgSiteAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_potterheadsanonymouscom.py b/fanficfare/adapters/adapter_potterheadsanonymouscom.py index 436055d..94d9646 100644 --- a/fanficfare/adapters/adapter_potterheadsanonymouscom.py +++ b/fanficfare/adapters/adapter_potterheadsanonymouscom.py @@ -170,7 +170,7 @@ class PotterHeadsAnonymousComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_pretendercentrecom.py b/fanficfare/adapters/adapter_pretendercentrecom.py index fcd38a7..edab7ab 100644 --- a/fanficfare/adapters/adapter_pretendercentrecom.py +++ b/fanficfare/adapters/adapter_pretendercentrecom.py @@ -125,7 +125,7 @@ class PretenderCenterComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_psychficcom.py b/fanficfare/adapters/adapter_psychficcom.py index 183c91c..8861383 100644 --- a/fanficfare/adapters/adapter_psychficcom.py +++ b/fanficfare/adapters/adapter_psychficcom.py @@ -121,7 +121,7 @@ class PsychFicComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_qafficcom.py b/fanficfare/adapters/adapter_qafficcom.py index 272990d..438ed55 100644 --- a/fanficfare/adapters/adapter_qafficcom.py +++ b/fanficfare/adapters/adapter_qafficcom.py @@ -122,7 +122,7 @@ class QafFicComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_samandjacknet.py b/fanficfare/adapters/adapter_samandjacknet.py index 2d7b152..4946a6c 100644 --- a/fanficfare/adapters/adapter_samandjacknet.py +++ b/fanficfare/adapters/adapter_samandjacknet.py @@ -198,7 +198,7 @@ class SamAndJackNetAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_samdeanarchivenu.py b/fanficfare/adapters/adapter_samdeanarchivenu.py index d04ae92..95683c9 100644 --- a/fanficfare/adapters/adapter_samdeanarchivenu.py +++ b/fanficfare/adapters/adapter_samdeanarchivenu.py @@ -94,7 +94,7 @@ class SamDeanArchiveNuAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_scarheadnet.py b/fanficfare/adapters/adapter_scarheadnet.py index fd269fa..d7d3557 100644 --- a/fanficfare/adapters/adapter_scarheadnet.py +++ b/fanficfare/adapters/adapter_scarheadnet.py @@ -170,7 +170,7 @@ class ScarHeadNetAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_scarvesandcoffeenet.py b/fanficfare/adapters/adapter_scarvesandcoffeenet.py index 7903c9a..4936f97 100644 --- a/fanficfare/adapters/adapter_scarvesandcoffeenet.py +++ b/fanficfare/adapters/adapter_scarvesandcoffeenet.py @@ -130,7 +130,7 @@ class ScarvesAndCoffeeNetAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_sheppardweircom.py b/fanficfare/adapters/adapter_sheppardweircom.py index a10183c..a41ac39 100644 --- a/fanficfare/adapters/adapter_sheppardweircom.py +++ b/fanficfare/adapters/adapter_sheppardweircom.py @@ -169,7 +169,7 @@ class SheppardWeirComAdapter(BaseSiteAdapter): # XXX raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_sinfuldesireorg.py b/fanficfare/adapters/adapter_sinfuldesireorg.py index 0e7cf45..f1383fe 100644 --- a/fanficfare/adapters/adapter_sinfuldesireorg.py +++ b/fanficfare/adapters/adapter_sinfuldesireorg.py @@ -121,7 +121,7 @@ class SinfulDesireOrgAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_storiesonlinenet.py b/fanficfare/adapters/adapter_storiesonlinenet.py index bad8f4c..d1fa7d8 100644 --- a/fanficfare/adapters/adapter_storiesonlinenet.py +++ b/fanficfare/adapters/adapter_storiesonlinenet.py @@ -139,7 +139,7 @@ class StoriesOnlineNetAdapter(BaseSiteAdapter): data = self._fetchUrl(url+":i",usecache=False) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") elif "Error! The story you're trying to access is being filtered by your choice of contents filtering." in data: raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Error! The story you're trying to access is being filtered by your choice of contents filtering.") diff --git a/fanficfare/adapters/adapter_tenhawkpresentscom.py b/fanficfare/adapters/adapter_tenhawkpresentscom.py index 849daf5..0583133 100644 --- a/fanficfare/adapters/adapter_tenhawkpresentscom.py +++ b/fanficfare/adapters/adapter_tenhawkpresentscom.py @@ -134,7 +134,7 @@ class TenhawkPresentsComSiteAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_thealphagatecom.py b/fanficfare/adapters/adapter_thealphagatecom.py index 46242d4..73d2bac 100644 --- a/fanficfare/adapters/adapter_thealphagatecom.py +++ b/fanficfare/adapters/adapter_thealphagatecom.py @@ -90,7 +90,7 @@ class TheAlphaGateComAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_themasquenet.py b/fanficfare/adapters/adapter_themasquenet.py index e80458c..6162c1f 100644 --- a/fanficfare/adapters/adapter_themasquenet.py +++ b/fanficfare/adapters/adapter_themasquenet.py @@ -168,7 +168,7 @@ class TheMasqueNetAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_thepetulantpoetesscom.py b/fanficfare/adapters/adapter_thepetulantpoetesscom.py index 2d5b9f2..b07f13d 100644 --- a/fanficfare/adapters/adapter_thepetulantpoetesscom.py +++ b/fanficfare/adapters/adapter_thepetulantpoetesscom.py @@ -129,7 +129,7 @@ class ThePetulantPoetessComAdapter(BaseSiteAdapter): data = self._fetchUrl(url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_tokrafandomnetcom.py b/fanficfare/adapters/adapter_tokrafandomnetcom.py index d245754..2e6f054 100644 --- a/fanficfare/adapters/adapter_tokrafandomnetcom.py +++ b/fanficfare/adapters/adapter_tokrafandomnetcom.py @@ -122,7 +122,7 @@ class TokraFandomnetComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_trekiverseorg.py b/fanficfare/adapters/adapter_trekiverseorg.py index b78e243..fb266fb 100644 --- a/fanficfare/adapters/adapter_trekiverseorg.py +++ b/fanficfare/adapters/adapter_trekiverseorg.py @@ -165,7 +165,7 @@ class TrekiverseOrgAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_tthfanficorg.py b/fanficfare/adapters/adapter_tthfanficorg.py index 2499c38..3f903a0 100644 --- a/fanficfare/adapters/adapter_tthfanficorg.py +++ b/fanficfare/adapters/adapter_tthfanficorg.py @@ -172,17 +172,22 @@ class TwistingTheHellmouthSiteAdapter(BaseSiteAdapter): descurl=authorurl authorsoup = self.make_soup(authordata) # author can have several pages, scan until we find it. - while( not authorsoup.find('a', href=re.compile(r"^/Story-"+self.story.getMetadata('storyId')+'/')) ): + # find('a', href=re.compile(r"^/Story-"+self.story.getMetadata('storyId')+'/')) ): + logger.info("authsoup:%s"%authorsoup) + while( not authorsoup.find('div', {'id':'st'+self.story.getMetadata('storyId'), 'class':re.compile(r"storylistitem")}) ): nextarrow = authorsoup.find('a', {'class':'arrowf'}) if not nextarrow: ## if rating is set lower than story, it won't be ## visible on author lists unless. The *story* is ## visible via the url, just not the entry on ## author list. - raise exceptions.AdultCheckRequired(self.url) + logger.info("Story Not Found on Author List--Assuming needs Adult.") + raise exceptions.FailedToDownload("Story Not Found on Author List--Assume needs Adult?") + # raise exceptions.AdultCheckRequired(self.url) nextpage = 'http://'+self.host+nextarrow['href'] logger.debug("**AUTHOR** nextpage URL: "+nextpage) authordata = self._fetchUrl(nextpage) + logger.info("authsoup:%s"%authorsoup) descurl=nextpage authorsoup = self.make_soup(authordata) except urllib2.HTTPError, e: diff --git a/fanficfare/adapters/adapter_twcslibrarynet.py b/fanficfare/adapters/adapter_twcslibrarynet.py index aef477c..e799b2d 100644 --- a/fanficfare/adapters/adapter_twcslibrarynet.py +++ b/fanficfare/adapters/adapter_twcslibrarynet.py @@ -127,7 +127,7 @@ class TheWritersCoffeeShopComSiteAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # problems with some stories, but only in calibre. I suspect # issues with different SGML parsers in python. This is a diff --git a/fanficfare/adapters/adapter_twilightarchivescom.py b/fanficfare/adapters/adapter_twilightarchivescom.py index b65e6d1..2ee24bd 100644 --- a/fanficfare/adapters/adapter_twilightarchivescom.py +++ b/fanficfare/adapters/adapter_twilightarchivescom.py @@ -90,7 +90,7 @@ class TwilightArchivesComAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_twilightednet.py b/fanficfare/adapters/adapter_twilightednet.py index d839257..a830e83 100644 --- a/fanficfare/adapters/adapter_twilightednet.py +++ b/fanficfare/adapters/adapter_twilightednet.py @@ -118,7 +118,7 @@ class TwilightedNetSiteAdapter(BaseSiteAdapter): data = self._fetchUrl(url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # problems with some stories, but only in calibre. I suspect # issues with different SGML parsers in python. This is a diff --git a/fanficfare/adapters/adapter_walkingtheplankorg.py b/fanficfare/adapters/adapter_walkingtheplankorg.py index f4eeb60..1637fd6 100644 --- a/fanficfare/adapters/adapter_walkingtheplankorg.py +++ b/fanficfare/adapters/adapter_walkingtheplankorg.py @@ -106,7 +106,7 @@ class WalkingThePlankOrgAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_wolverineandroguecom.py b/fanficfare/adapters/adapter_wolverineandroguecom.py index a24f828..56fa706 100644 --- a/fanficfare/adapters/adapter_wolverineandroguecom.py +++ b/fanficfare/adapters/adapter_wolverineandroguecom.py @@ -90,7 +90,7 @@ class WolverineAndRogueComAdapter(BaseSiteAdapter): raise e if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/adapter_wraithbaitcom.py b/fanficfare/adapters/adapter_wraithbaitcom.py index aaf71e2..c79c191 100644 --- a/fanficfare/adapters/adapter_wraithbaitcom.py +++ b/fanficfare/adapters/adapter_wraithbaitcom.py @@ -102,7 +102,7 @@ class WraithBaitComAdapter(BaseSiteAdapter): raise exceptions.AdultCheckRequired(self.url) if "Access denied. This story has not been validated by the adminstrators of this site." in data: - raise exceptions.FailedToDownload(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") + raise exceptions.AccessDenied(self.getSiteDomain() +" says: Access denied. This story has not been validated by the adminstrators of this site.") # use BeautifulSoup HTML parser to make everything easier to find. soup = self.make_soup(data) diff --git a/fanficfare/adapters/base_xenforoforum_adapter.py-new b/fanficfare/adapters/base_xenforoforum_adapter.py-new new file mode 100644 index 0000000..5ec9dc6 --- /dev/null +++ b/fanficfare/adapters/base_xenforoforum_adapter.py-new @@ -0,0 +1,345 @@ +# -*- coding: utf-8 -*- + +# Copyright 2015 FanFicFare team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import time +import logging +import traceback +logger = logging.getLogger(__name__) +import re +import urllib2 + +from ..htmlcleanup import stripHTML +from .. import exceptions as exceptions + +from base_adapter import BaseSiteAdapter, makeDate + +logger = logging.getLogger(__name__) + +class BaseXenForoForumAdapter(BaseSiteAdapter): + + def __init__(self, config, url): + #logger.info("init url: "+url) + BaseSiteAdapter.__init__(self, config, url) + + self.decode = ["utf8", + "Windows-1252"] # 1252 is a superset of iso-8859-1. + # Most sites that claim to be + # iso-8859-1 (and some that claim to be + # utf8) are really windows-1252. + + + # get storyId from url--url validation guarantees query is only sid=1234 + self.story.setMetadata('storyId',self.parsedUrl.path.split('/',)[2]) + + # get storyId from url--url validation guarantees query correct + m = re.match(self.getSiteURLPattern(),url) + if m: + #logger.debug("groupdict:%s"%m.groupdict()) + if m.group('post'): + self.story.setMetadata('storyId',m.group('post')) + self._setURL(self.getURLPrefix() + '/posts/'+m.group('post')+'/') + else: + self.story.setMetadata('storyId',m.group('id')) + # normalized story URL. + self._setURL(self.getURLPrefix() + '/'+m.group('tp')+'/'+self.story.getMetadata('storyId')+'/') + else: + raise exceptions.InvalidStoryURL(url, + self.getSiteDomain(), + self.getSiteExampleURLs()) + + # Each adapter needs to have a unique site abbreviation. + self.story.setMetadata('siteabbrev','fsb') + + # The date format will vary from site to site. + # http://docs.python.org/library/datetime.html#strftime-strptime-behavior + self.dateformat = "%b %d, %Y at %I:%M %p" + + @classmethod + def getConfigSections(cls): + "Only needs to be overriden if has additional ini sections." + return ['base_xenforoforum',cls.getConfigSection()] + + @classmethod + def getURLPrefix(cls): + # The site domain. Does have www here, if it uses it. + return 'https://' + cls.getSiteDomain() + + @classmethod + def getSiteExampleURLs(cls): + return cls.getURLPrefix()+"/threads/some-story-name.123456/ "+cls.getURLPrefix()+"/posts/123456/" + + def getSiteURLPattern(self): + return r"https?://"+re.escape(self.getSiteDomain())+r"/(?Pthreads|posts)/(.+\.)?(?P\d+)/?[^#]*?(#post-(?P\d+))?$" + + def use_pagecache(self): + ''' + adapters that will work with the page cache need to implement + this and change it to True. + ''' + return True + + def performLogin(self): + params = {} + + if self.password: + params['login'] = self.username + params['password'] = self.password + else: + params['login'] = self.getConfig("username") + params['password'] = self.getConfig("password") + params['register'] = '0' + params['cookie_check'] = '1' + params['_xfToken'] = '' + params['redirect'] = 'https://' + self.getSiteDomain() + '/' + + if not params['password']: + return + + ## https://forum.questionablequesting.com/login/login + loginUrl = 'https://' + self.getSiteDomain() + '/login/login' + logger.debug("Will now login to URL (%s) as (%s)" % (loginUrl, + params['login'])) + + # soup = self.make_soup(self._fetchUrl(loginUrl)) + # params['ctkn']=soup.find('input', {'name':'ctkn'})['value'] + # params[soup.find('input', {'id':'password'})['name']] = params['password'] + + d = self._fetchUrl(loginUrl, params) + + if "Log Out" not in d : + logger.info("Failed to login to URL %s as %s" % (loginUrl, + params['login'])) + raise exceptions.FailedToLogin(self.url,params['login']) + return False + else: + return True + + ## Getting the chapter list and the meta data, plus 'is adult' checking. + def extractChapterUrlsAndMetadata(self): + + useurl = self.url + logger.info("url: "+useurl) + + try: + (data,opened) = self._fetchUrlOpened(useurl) + useurl = opened.geturl() + logger.info("use useurl: "+useurl) + except urllib2.HTTPError, e: + if e.code == 404: + raise exceptions.StoryDoesNotExist(self.url) + elif e.code == 403: + self.performLogin() + (data,opened) = self._fetchUrlOpened(useurl) + useurl = opened.geturl() + logger.info("use useurl: "+useurl) + else: + raise + + # use BeautifulSoup HTML parser to make everything easier to find. + soup = self.make_soup(data) + + a = soup.find('h3',{'class':'userText'}).find('a') + self.story.addToList('authorId',a['href'].split('/')[1]) + self.story.addToList('authorUrl',self.getURLPrefix()+'/'+a['href']) + self.story.addToList('author',a.text) + + h1 = soup.find('div',{'class':'titleBar'}).h1 + self.story.setMetadata('title',stripHTML(h1)) + + if '#' in useurl: + anchorid = useurl.split('#')[1] + soup = soup.find('li',id=anchorid) + else: + # try threadmarks if no '#' in url + # Use a post specific URL to get first post without using threadmarks. + threadmarksa = soup.find('a',{'class':'threadmarksTrigger'}) + if threadmarksa: + soupmarks = self.make_soup(self._fetchUrl(self.getURLPrefix()+'/'+threadmarksa['href'])) + markas = [] + ol = soupmarks.find('ol',{'class':'overlayScroll'}) + if ol: + markas = ol.find_all('a') + else: + ## SV changed their threadmarks. Not isolated to + ## SV only incase SB or QQ make the same change. + markas = soupmarks.find('div',{'class':'threadmarks'}).find_all('a',{'class':'PreviewTooltip'}) + if markas: + self.chapterUrls.append(("First Post",useurl)) + for (atag,url,name) in [ (x,x['href'],stripHTML(x)) for x in markas ]: + date = self.make_date(atag.find_next_sibling('div',{'class':'extra'})) + if not self.story.getMetadataRaw('datePublished') or date < self.story.getMetadataRaw('datePublished'): + self.story.setMetadata('datePublished', date) + if not self.story.getMetadataRaw('dateUpdated') or date > self.story.getMetadataRaw('dateUpdated'): + self.story.setMetadata('dateUpdated', date) + + self.chapterUrls.append((name,self.getURLPrefix()+'/'+url)) + # https://forums.spacebattles.com/threads/aberration-worm-d-d.369992/ + if re.match(rr"https?://"+re.escape(self.getSiteDomain())+r"/(?Pthreads|posts)/(.+\.)?(?P\d+)/?[^#]*?$",url) + m = re.match(,url) + if url == useurl and 'First Post' == self.chapterUrls[0][0]: + # remove "First Post" if included in list. + logger.debug("delete dup 'First Post' chapter: %s %s"%self.chapterUrls[0]) + del self.chapterUrls[0] + + ## only use tags if threadmarks for chapters. + ## a bit arbitrary, but likely. + for tag in soup.findAll('a',{'class':'tag'}): + tstr = stripHTML(tag) + if self.getConfig('capitalize_forumtags'): + tstr = tstr.title() + self.story.addToList('forumtags',tstr) + + soup = soup.find('li',{'class':'message'}) # limit first post for date stuff below. ('#' posts above) + + # Now go hunting for the 'chapter list'. + bq = soup.find('blockquote') # assume first posting contains TOC urls. + + bq.name='div' + + for iframe in bq.find_all('iframe'): + iframe.extract() # calibre book reader & editor don't like iframes to youtube. + + for qdiv in bq.find_all('div',{'class':'quoteExpand'}): + qdiv.extract() # Remove
click to expand
+ + self.setDescription(useurl,bq) + + # otherwise, use first post links--include first post since + # that's often also the first chapter. + if not self.chapterUrls: + self.chapterUrls.append(("First Post",useurl)) + for (url,name) in [ (x['href'],stripHTML(x)) for x in bq.find_all('a') ]: + #logger.debug("found chapurl:%s"%url) + if not url.startswith('http'): + url = self.getURLPrefix()+'/'+url + + if ( url.startswith(self.getURLPrefix()) or + url.startswith('http://'+self.getSiteDomain()) or + url.startswith('https://'+self.getSiteDomain()) ) and ('/posts/' in url or '/threads/' in url): + + # brute force way to deal with SB's http->https change when hardcoded http urls. + url = url.replace('http://'+self.getSiteDomain(),self.getURLPrefix()) + + url = re.sub(r'(^[\'"]+|[\'"]+$)','',url) # strip leading or trailing '" from incorrect quoting. + url = re.sub(r'like$','',url) # strip 'like' if incorrect 'like' link instead of proper post URL. + + logger.debug("(ch:%s)used chapurl:%s"%(len(self.chapterUrls)+1,url)) + self.chapterUrls.append((name,url)) + if url == useurl and 'First Post' == self.chapterUrls[0][0]: + # remove "First Post" if included in list. + logger.debug("delete dup 'First Post' chapter: %s %s"%self.chapterUrls[0]) + del self.chapterUrls[0] + + # Didn't use threadmarks, so take created/updated dates + # from the 'first' posting created and updated. + date = self.make_date(soup.find('a',{'class':'datePermalink'})) + if date: + self.story.setMetadata('datePublished', date) + self.story.setMetadata('dateUpdated', date) # updated overwritten below if found. + + date = self.make_date(soup.find('div',{'class':'editDate'})) + if date: + self.story.setMetadata('dateUpdated', date) + + self.story.setMetadata('numChapters',len(self.chapterUrls)) + + def make_date(self,parenttag): # forums use a BS thing where dates + # can appear different if recent. + datestr=None + try: + datetag = parenttag.find('span',{'class':'DateTime'}) + if datetag: + datestr = datetag['title'] + else: + datetag = parenttag.find('abbr',{'class':'DateTime'}) + if datetag: + datestr="%s at %s"%(datetag['data-datestring'],datetag['data-timestring']) + # Apr 24, 2015 at 4:39 AM + # May 1, 2015 at 5:47 AM + datestr = re.sub(r' (\d[^\d])',r' 0\1',datestr) # add leading 0 for single digit day & hours. + return makeDate(datestr, self.dateformat) + except: + logger.debug('No date found in %s'%parenttag) + return None + + # grab the text for an individual chapter. + def getChapterText(self, url): + logger.debug('Getting chapter text from: %s' % url) + + ## there's some history of stories with links to the wrong + ## page. This changes page#post URLs to perma-link URLs. + ## Which will be redirected back to page#posts, but the + ## *correct* ones. + # http://forums.sufficientvelocity.com/threads/harry-potter-and-the-not-fatal-at-all-cultural-exchange-program.330/page-4#post-39915 + # https://forums.sufficientvelocity.com/posts/39915/ + if '#post-' in url: + url = self.getURLPrefix()+'/posts/'+url.split('#post-')[1]+'/' + + ## Same as above except for for case where author mistakenly + ## used the reply link instead of normal link to post. + # "http://forums.spacebattles.com/threads/manager-worm-story-thread-iv.301602/reply?quote=15962513" + # https://forums.spacebattles.com/posts/ + if 'reply?quote=' in url: + url = self.getURLPrefix()+'/posts/'+url.split('reply?quote=')[1]+'/' + + try: + origurl = url + (data,opened) = self._fetchUrlOpened(url) + url = opened.geturl() + if '#' in origurl and '#' not in url: + url = url + origurl[origurl.index('#'):] + logger.debug("chapter URL redirected to: %s"%url) + + soup = self.make_soup(data) + + if '#' in url: + anchorid = url.split('#')[1] + soup = soup.find('li',id=anchorid) + + bq = soup.find('blockquote') + + bq.name='div' + + for iframe in bq.find_all('iframe'): + iframe.extract() # calibre book reader & editor don't like iframes to youtube. + + for qdiv in bq.find_all('div',{'class':'quoteExpand'}): + qdiv.extract() # Remove
click to expand
+ + except Exception as e: + if self.getConfig('continue_on_chapter_error'): + bq = self.make_soup("""
+

Error

+

FanFicFare failed to download this chapter. Because you have +continue_on_chapter_error set to true in your personal.ini, the download continued.

+

Chapter URL:
%s

+

Error:

%s

+
"""%(url,traceback.format_exc())) + else: + raise + + # XenForo uses + return self.utf8FromSoup(self.getURLPrefix()+'/',bq) + + +def normalize_forum_url(url): + ''' + Take URLs of form: + https://forums.spacebattles.com/threads/heredity-ii-worm-au.311819/page-72#post-20211500 + "/threads/some-story-name.123456/ "+cls.getURLPrefix()+"/posts/123456/" + + ''' diff --git a/fanficfare/cli.py b/fanficfare/cli.py index 0a4e95d..6c49c32 100644 --- a/fanficfare/cli.py +++ b/fanficfare/cli.py @@ -365,12 +365,14 @@ def do_download(arg, del adapter - except exceptions.InvalidStoryURL, isu: + except exceptions.InvalidStoryURL as isu: print isu - except exceptions.StoryDoesNotExist, dne: + except exceptions.StoryDoesNotExist as dne: print dne - except exceptions.UnknownSite, us: + except exceptions.UnknownSite as us: print us + except exceptions.AccessDenied as ad: + print ad if __name__ == '__main__': diff --git a/fanficfare/exceptions.py b/fanficfare/exceptions.py index c68b22a..ec4dc8f 100644 --- a/fanficfare/exceptions.py +++ b/fanficfare/exceptions.py @@ -24,6 +24,13 @@ class FailedToDownload(Exception): def __str__(self): return self.error +class AccessDenied(Exception): + def __init__(self,error): + self.error=error + + def __str__(self): + return self.error + class RejectImage(Exception): def __init__(self,error): self.error=error