mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-30 20:52:57 +01:00
Added status metadata to wuxiaworld and royalroadl (#289)
Also category (FanFiction vs Original) for adapter_royalroadl
This commit is contained in:
parent
83bceb8154
commit
8010d50ab8
4 changed files with 26 additions and 1 deletions
|
|
@ -1867,6 +1867,9 @@ extra_valid_entries:stars
|
|||
## cover image. This lets you exclude them.
|
||||
cover_exclusion_regexp:(imgur.com/dzOACJf.png|/forum/images/smilies/)
|
||||
|
||||
## Clear FanFiction from defaults, site has fanfictions and original fiction.
|
||||
extratags:
|
||||
|
||||
[samandjack.net]
|
||||
## Some sites require login (or login for some rated stories) The
|
||||
## program can prompt you, or you can save it in config. In
|
||||
|
|
|
|||
|
|
@ -159,6 +159,16 @@ class RoyalRoadAdapter(BaseSiteAdapter):
|
|||
for tag in genre:
|
||||
self.story.addToList('genre',tag)
|
||||
|
||||
for label in [stripHTML(a) for a in soup.find_all('span', {'class':'label'})]:
|
||||
if 'COMPLETED' == label:
|
||||
self.story.setMetadata('status', 'Completed')
|
||||
elif ('ONGOING' == label) or ('HIATUS' == label):
|
||||
self.story.setMetadata('status', 'In-Progress')
|
||||
elif 'Fan Fiction' == label:
|
||||
self.story.addToList('category', 'FanFiction')
|
||||
elif 'Original' == label:
|
||||
self.story.addToList('category', 'Original')
|
||||
|
||||
# 'rating' in FFF speak means G, PG, Teen, Restricted, etc.
|
||||
# 'stars' is used instead for RR's 1-5 stars rating.
|
||||
stars=soup.find(attrs=dict(property="books:rating:value"))['content']
|
||||
|
|
|
|||
|
|
@ -90,7 +90,16 @@ class WuxiaWorldComSiteAdapter(BaseSiteAdapter):
|
|||
self.story.setMetadata('authorId', author_name.lower())
|
||||
self.story.setMetadata('title', ld['headline'])
|
||||
self.story.setMetadata('datePublished', self._parse_date(ld['datePublished']))
|
||||
self.story.setMetadata('tags', [stripHTML(a) for a in soup.select('.media-body .tags a')])
|
||||
|
||||
tags = [stripHTML(a) for a in soup.select('.media-body .tags a')]
|
||||
for tag in tags:
|
||||
if 'Completed' == tag:
|
||||
self.story.setMetadata('status', 'Completed')
|
||||
tags.remove('Completed')
|
||||
elif 'Ongoing' == tag:
|
||||
self.story.setMetadata('status', 'In-Progress')
|
||||
tags.remove('Ongoing')
|
||||
self.story.setMetadata('tags', tags)
|
||||
|
||||
cover_url = ld['image']
|
||||
if not cover_url:
|
||||
|
|
|
|||
|
|
@ -1901,6 +1901,9 @@ extra_valid_entries:stars
|
|||
## cover image. This lets you exclude them.
|
||||
cover_exclusion_regexp:(imgur.com/dzOACJf.png|/forum/images/smilies/)
|
||||
|
||||
## Clear FanFiction from defaults, site has fanfictions and original fiction.
|
||||
extratags:
|
||||
|
||||
[samandjack.net]
|
||||
## Some sites require login (or login for some rated stories) The
|
||||
## program can prompt you, or you can save it in config. In
|
||||
|
|
|
|||
Loading…
Reference in a new issue