update build_supportedsites.py

This commit is contained in:
Mike Fährmann
2019-01-09 14:21:19 +01:00
parent 1e4d351ad3
commit e53cdfd6a8
5 changed files with 21 additions and 13 deletions

View File

@@ -87,7 +87,7 @@ SUBCATEGORY_MAP = {
}
AUTH_MAP = {
"batoto" : "Optional",
"danbooru" : "Optional",
"deviantart" : "Optional (OAuth)",
"exhentai" : "Optional",
"flickr" : "Optional (OAuth)",
@@ -176,7 +176,7 @@ def build_list():
last = None
for extr in gallery_dl.extractor.extractors():
if extr.category in IGNORE_LIST:
if not extr.category or extr.category in IGNORE_LIST:
continue
if extr.category == last or not last:
classes.append(extr)
@@ -200,9 +200,15 @@ def build_list():
def get_domain(classes):
try:
cls = classes[0]
url = sys.modules[cls.__module__].__doc__.split()[-1]
if url.startswith("http"):
return url
if hasattr(cls, "test") and cls.test:
url = cls.test[0][0]
return url[:url.find("/", 8)+1]
scheme = "https" if hasattr(cls, "https") and cls.https else "http"
host = cls.__doc__.split()[-1]
return scheme + "://" + host + "/"