From d969dbbab1c143b1a8cd2304505b67397e98cccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 28 Jun 2025 09:01:03 +0200 Subject: [PATCH] [common] fix bug in df6f4e53 when first group is empty --- gallery_dl/extractor/common.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 9cf07335..03956654 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -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