From babfc35f7b0ecacb2b3d7776e20fad3285fd9695 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 2 Jul 2014 19:48:43 -0500 Subject: [PATCH] Add site specific reviews to wraithbait.com, allow ffnet story specific covers. --- defaults.ini | 10 ++++++++-- fanficdownloader/adapters/adapter_wraithbaitcom.py | 4 ++++ plugin-defaults.ini | 10 ++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/defaults.ini b/defaults.ini index e4eca40..a4fc70e 100644 --- a/defaults.ini +++ b/defaults.ini @@ -1383,8 +1383,11 @@ type_label:Type of Couple [www.fanfiction.net] user_agent: ## fanfiction.net's 'cover' images are really just tiny thumbnails. -## Change this to false to use them anyway. -never_make_cover: true +## Set this to true to never use them. +#never_make_cover: false + +## fanfiction.net shows the user's +cover_exclusion_regexp:/imageu/ ## fanfiction.net is blocking people more aggressively. If you ## download fewer stories less often you can likely get by with @@ -1808,6 +1811,9 @@ extracharacters:Wolverine,Rogue ## Site dedicated to these categories/characters/ships extracategories:Stargate: Atlantis +extra_valid_entries:reviews +reviews_label:Reviews + [overrides] ## It may sometimes be useful to override all of the specific format, ## site and site:format sections in your private configuration. For diff --git a/fanficdownloader/adapters/adapter_wraithbaitcom.py b/fanficdownloader/adapters/adapter_wraithbaitcom.py index ab31c9f..89d4316 100644 --- a/fanficdownloader/adapters/adapter_wraithbaitcom.py +++ b/fanficdownloader/adapters/adapter_wraithbaitcom.py @@ -125,6 +125,10 @@ class WraithBaitComAdapter(BaseSiteAdapter): rating=pt.text.split('[')[1].split(']')[0] self.story.setMetadata('rating', rating) + st = soup.find('div', {'class' : 'storytitle'}) + a = st.findAll('a', href=re.compile(r'reviews.php\?type=ST&item='+self.story.getMetadata('storyId')+"$"))[1] # second one. + self.story.setMetadata('reviews',stripHTML(a)) + # Find the chapters: for chapter in soup.findAll('a', href=re.compile(r'viewstory.php\?sid='+self.story.getMetadata('storyId')+"&chapter=\d+$")): # include author on chapters if multiple authors. diff --git a/plugin-defaults.ini b/plugin-defaults.ini index b7769af..344650e 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -1377,8 +1377,11 @@ type_label:Type of Couple [www.fanfiction.net] user_agent: ## fanfiction.net's 'cover' images are really just tiny thumbnails. -## Change this to false to use them anyway. -never_make_cover: true +## Set this to true to never use them. +#never_make_cover: false + +## fanfiction.net shows the user's +cover_exclusion_regexp:/imageu/ ## fanfiction.net is blocking people more aggressively. If you ## download fewer stories less often you can likely get by with @@ -1808,6 +1811,9 @@ extracharacters:Wolverine,Rogue ## Site dedicated to these categories/characters/ships extracategories:Stargate: Atlantis +extra_valid_entries:reviews +reviews_label:Reviews + [overrides] ## It may sometimes be useful to override all of the specific format, ## site and site:format sections in your private configuration. For