mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-08 12:36:11 +02:00
fix list index out of range error
- fixes "Failed List Index Out of Range" on url "http://royalroadl.com/fiction/1612"
This commit is contained in:
parent
eade66f513
commit
5ca33837d4
1 changed files with 5 additions and 3 deletions
|
|
@ -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'])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue