Raise error instead when the correct metadata can't be found on the author's page

This commit is contained in:
cryzed 2014-06-09 02:05:32 +02:00
parent db3878668b
commit 5823d335a4
2 changed files with 4 additions and 0 deletions

View file

@ -97,6 +97,8 @@ class BloodshedverseComAdapter(BaseSiteAdapter):
# parse the element
if query_data['no'] == story_no:
break
else:
raise exceptions.FailedToDownload(self.url)
title_anchor = list_box.find('a', {'class': 'fictitle'})
self.story.setMetadata('title', title_anchor.string.strip())

View file

@ -97,6 +97,8 @@ class NocturnalLightNetAdapter(BaseSiteAdapter):
# parse the element
if story_id == url_tokens[url_tokens.index('story')+1]:
break
else:
raise exceptions.FailedToDownload(self.url)
title = listbox.a.string
self.story.setMetadata('title', title)