[common] fix bug in df6f4e53 when first group is empty

This commit is contained in:
Mike Fährmann
2025-06-28 09:01:03 +02:00
parent 5e61fe8668
commit d969dbbab1

View File

@@ -731,9 +731,8 @@ class GalleryExtractor(Extractor):
def __init__(self, match, url=None):
Extractor.__init__(self, match)
if url is None:
path = self.groups[0]
self.page_url = self.root + path if path[0] == "/" else None
if url is None and (path := self.groups[0]) and path[0] == "/":
self.page_url = f"{self.root}{path}"
else:
self.page_url = url
@@ -829,9 +828,8 @@ class MangaExtractor(Extractor):
def __init__(self, match, url=None):
Extractor.__init__(self, match)
if url is None:
path = self.groups[0]
self.page_url = self.root + path if path[0] == "/" else None
if url is None and (path := self.groups[0]) and path[0] == "/":
self.page_url = f"{self.root}{path}"
else:
self.page_url = url