1
0
Fork 0
mirror of https://github.com/kemayo/leech synced 2025-12-06 08:22:56 +01:00

Better error for an Arbitrary story that fetches no content

This commit is contained in:
David Lynch 2024-11-23 23:07:16 -06:00
parent 85da618cb2
commit ffb8e54e91
2 changed files with 6 additions and 3 deletions

View file

@ -111,10 +111,10 @@ def open_story(site, url, session, login, options):
try:
story = handler.extract(url)
except sites.SiteException as e:
logger.error(e.args)
logger.error(e)
return
if not story:
raise Exception("Couldn't extract story")
logger.error("Couldn't extract story")
return story

View file

@ -6,7 +6,7 @@ import datetime
import json
import re
import os.path
from . import register, Site, Section, Chapter
from . import register, Site, Section, Chapter, SiteException
logger = logging.getLogger(__name__)
@ -94,6 +94,9 @@ class Arbitrary(Site):
else:
content_url = False
if not story:
raise SiteException("No story content found; check the content selectors")
return story
def _chapter(self, url, definition, title=False):