fix supportedsites.py for modules without docstring

(fixes #1332)
This commit is contained in:
Mike Fährmann
2021-02-21 22:57:37 +01:00
parent 7b5ee922b7
commit e39aea42cd
3 changed files with 16 additions and 5 deletions

View File

@@ -212,9 +212,12 @@ IGNORE_LIST = (
def domain(cls):
"""Return the web-domain related to an extractor class"""
url = sys.modules[cls.__module__].__doc__.split()[-1]
if url.startswith("http"):
return url
try:
url = sys.modules[cls.__module__].__doc__.split()[-1]
if url.startswith("http"):
return url
except Exception:
pass
if hasattr(cls, "root") and cls.root:
return cls.root + "/"