allow BaseExtractors to use the domain pf the matched URL

This commit is contained in:
Mike Fährmann
2022-02-10 01:38:50 +01:00
parent c0fddcefc5
commit b4f8e15a1f
2 changed files with 12 additions and 1 deletions

View File

@@ -349,6 +349,12 @@ def build_extractor_list():
for category, root in extr.instances:
base[category].append(extr.subcategory)
if category not in domains:
if not root:
# use domain from first matching test
for url, _ in extr._get_tests():
if extr.from_url(url).category == category:
root = url[:url.index("/", 8)]
break
domains[category] = root + "/"
# sort subcategory lists