mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-01-06 08:05:28 +01:00
Fix parsing of author name for webnovel.com (hopefully) (#232)
This commit is contained in:
parent
20e96aa056
commit
e643315532
1 changed files with 4 additions and 2 deletions
|
|
@ -137,13 +137,15 @@ class WWWWebNovelComAdapter(BaseSiteAdapter):
|
|||
tag.extract()
|
||||
self.story.setMetadata('title', stripHTML(title))
|
||||
|
||||
# TODO: This should be more robust...
|
||||
# Find authorid and URL from... author url.
|
||||
paras = bookdetails.find_all('p')
|
||||
for para in paras:
|
||||
parat = stripHTML(para)
|
||||
if parat[:7] == 'Author:':
|
||||
self.story.setMetadata('author', parat.replace('Author:', '').strip())
|
||||
self.story.setMetadata('authorId', parat.replace('Author:', '').strip())
|
||||
author = parat.split('Author:', 1)[1].split(u'\xb7', 1)[0].strip()
|
||||
self.story.setMetadata('author', author)
|
||||
self.story.setMetadata('authorId', author)
|
||||
# There is no authorUrl for this site, so I'm setting it to the story url
|
||||
# otherwise it defaults to the file location
|
||||
self.story.setMetadata('authorUrl', url)
|
||||
|
|
|
|||
Loading…
Reference in a new issue