implement 'text.root_from_url()'

use domain from input URL for kemono
This commit is contained in:
Mike Fährmann
2022-03-01 02:56:51 +01:00
parent 92c492dc09
commit bddcec49f1
4 changed files with 21 additions and 3 deletions

View File

@@ -621,8 +621,7 @@ class BaseExtractor(Extractor):
if index:
self.category, self.root = self.instances[index-1]
if not self.root:
url = text.ensure_http_scheme(match.group(0))
self.root = url[:url.index("/", 8)]
self.root = text.root_from_url(match.group(0))
else:
self.root = group
self.category = group.partition("://")[2]

View File

@@ -30,8 +30,8 @@ class KemonopartyExtractor(Extractor):
def __init__(self, match):
if match.group(1) == "coomer":
self.category = "coomerparty"
self.root = "https://coomer.party"
self.cookiedomain = ".coomer.party"
self.root = text.root_from_url(match.group(0))
Extractor.__init__(self, match)
def items(self):