mirror of
https://github.com/wassname/FanFicFare.git
synced 2026-09-10 11:40:24 +08:00
Merge pull request #146 from wassname/master
fix list index out of range error
This commit is contained in:
@@ -115,9 +115,11 @@ class RoyalRoadAdapter(BaseSiteAdapter):
|
||||
|
||||
# Find authorid and URL from... author url.
|
||||
author = soup.find('',{'class':'mt-card-social'})
|
||||
authorId = author.findAll('li')[1].a['href'].split('=')[-1]
|
||||
self.story.setMetadata('authorId',authorId)
|
||||
self.story.setMetadata('authorUrl','http://'+self.host+'/member.php?action=profile&uid='+authorId)
|
||||
author_link = author.findAll('li')[-1]
|
||||
if author_link:
|
||||
authorId = author_link.a['href'].split('=')[-1]
|
||||
self.story.setMetadata('authorId', authorId)
|
||||
self.story.setMetadata('authorUrl','http://'+self.host+'/member.php?action=profile&uid='+authorId)
|
||||
self.story.setMetadata('author',soup.find(attrs=dict(property="books:author"))['content'])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user