diff options
| author | 2021-12-30 01:56:51 -0500 | |
|---|---|---|
| committer | 2021-12-30 01:56:51 -0500 | |
| commit | 6a849c995173dee7ec29ae2191120bb3a1d74405 (patch) | |
| tree | b04906295296f50556f461e443a4c7633afa4b6d /gallery_dl/extractor/common.py | |
| parent | 6a387c1b3e40110ca315d5a4d260298fa5aa3eb6 (diff) | |
| parent | 7bc30b43b70556630b4a93c03fefc0d888e3d19f (diff) | |
Update upstream source from tag 'upstream/1.20.0'
Update to upstream version '1.20.0'
with Debian dir f271e8ffa4e8d9b8e41546097fc4a4e161e73f8f
Diffstat (limited to 'gallery_dl/extractor/common.py')
| -rw-r--r-- | gallery_dl/extractor/common.py | 11 |
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): |
