summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/common.py')
-rw-r--r--gallery_dl/extractor/common.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py
index e80366e..c440aee 100644
--- a/gallery_dl/extractor/common.py
+++ b/gallery_dl/extractor/common.py
@@ -571,7 +571,11 @@ class BaseExtractor(Extractor):
if not self.category:
for index, group in enumerate(match.groups()):
if group is not None:
- self.category, self.root = self.instances[index]
+ if index:
+ self.category, self.root = self.instances[index-1]
+ else:
+ self.root = group
+ self.category = group.partition("://")[2]
break
Extractor.__init__(self, match)
@@ -594,7 +598,10 @@ class BaseExtractor(Extractor):
pattern = re.escape(root[root.index(":") + 3:])
pattern_list.append(pattern + "()")
- return r"(?:https?://)?(?:" + "|".join(pattern_list) + r")"
+ return (
+ r"(?:" + cls.basecategory + r":(https?://[^/?#]+)|"
+ r"(?:https?://)?(?:" + "|".join(pattern_list) + r"))"
+ )
class HTTPSAdapter(HTTPAdapter):