diff --git a/defaults.ini b/defaults.ini index fda104f2..6778b69c 100644 --- a/defaults.ini +++ b/defaults.ini @@ -622,7 +622,7 @@ cover_exclusion_regexp:/images/.*?ribbon.gif ## composite metadata entries. dramione.org, for example, adds ## 'cliches' and then defines as the composite of hermiones,dracos in ## include_in_cliches. -extra_valid_entries:themes,hermiones,dracos,timeline,cliches +extra_valid_entries:themes,hermiones,dracos,timeline,cliches,read,reviews include_in_cliches:hermiones,dracos ## For another example, you could, by uncommenting this line, include @@ -722,6 +722,10 @@ extracharacters:Hermione Granger ## personal.ini, not defaults.ini. #is_adult:true +## Extra metadata that this adapter knows about. See [dramione.org] +## for examples of how to use them. +extra_valid_entries:read,reviews + [hlfiction.net] ## Site dedicated to these categories/characters/ships extracategories:Highlander diff --git a/fanficdownloader/adapters/adapter_dramioneorg.py b/fanficdownloader/adapters/adapter_dramioneorg.py index 9cd75745..db738d1b 100644 --- a/fanficdownloader/adapters/adapter_dramioneorg.py +++ b/fanficdownloader/adapters/adapter_dramioneorg.py @@ -237,6 +237,9 @@ class DramioneOrgAdapter(BaseSiteAdapter): if 'Word count' in label: self.story.setMetadata('numWords', value) + if 'Read' in label: + self.story.setMetadata('read', value) + if 'Categories' in label: cats = labelspan.parent.findAll('a',href=re.compile(r'browse.php\?type=categories')) for cat in cats: @@ -282,6 +285,14 @@ class DramioneOrgAdapter(BaseSiteAdapter): # I find it hard to care if the series parsing fails pass + try: + self.story.setMetadata('reviews', + stripHTML(soup.find('h2',{'id':'pagetitle'}). + findAll('a', href=re.compile(r'^reviews.php'))[1])) + except: + # I find it hard to care if the series parsing fails + pass + # grab the text for an individual chapter. def getChapterText(self, url): diff --git a/fanficdownloader/adapters/adapter_grangerenchantedcom.py b/fanficdownloader/adapters/adapter_grangerenchantedcom.py index b0876ec9..c121966e 100644 --- a/fanficdownloader/adapters/adapter_grangerenchantedcom.py +++ b/fanficdownloader/adapters/adapter_grangerenchantedcom.py @@ -227,6 +227,9 @@ class GrangerEnchantedCom(BaseSiteAdapter): if 'Word count' in label: self.story.setMetadata('numWords', value) + if 'Read' in label: + self.story.setMetadata('read', value) + if 'Categories' in label: cats = labelspan.parent.findAll('a',href=re.compile(r'browse.php\?type=categories')) for cat in cats: @@ -278,7 +281,14 @@ class GrangerEnchantedCom(BaseSiteAdapter): self.story.setMetadata('seriesUrl',series_url) break i+=1 - + except: + # I find it hard to care if the series parsing fails + pass + + try: + self.story.setMetadata('reviews', + stripHTML(soup.find('div',{'id':'sort'}). + findAll('a', href=re.compile(r'^reviews.php'))[1])) except: # I find it hard to care if the series parsing fails pass diff --git a/plugin-defaults.ini b/plugin-defaults.ini index 15335031..7f241de3 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -593,7 +593,7 @@ cover_exclusion_regexp:/images/.*?ribbon.gif ## composite metadata entries. dramione.org, for example, adds ## 'cliches' and then defines as the composite of hermiones,dracos in ## include_in_cliches. -extra_valid_entries:themes,hermiones,dracos,timeline,cliches +extra_valid_entries:themes,hermiones,dracos,timeline,cliches,read,reviews include_in_cliches:hermiones,dracos ## For another example, you could, by uncommenting this line, include @@ -709,6 +709,10 @@ extracharacters:Hermione Granger ## personal.ini, not defaults.ini. #is_adult:true +## Extra metadata that this adapter knows about. See [dramione.org] +## for examples of how to use them. +extra_valid_entries:read,reviews + [hlfiction.net] ## Site dedicated to these categories/characters/ships extracategories:Highlander