diff --git a/gallery_dl/extractor/pornpics.py b/gallery_dl/extractor/pornpics.py index 83f30648..4a51640d 100644 --- a/gallery_dl/extractor/pornpics.py +++ b/gallery_dl/extractor/pornpics.py @@ -20,10 +20,6 @@ class PornpicsExtractor(Extractor): root = "https://www.pornpics.com" request_interval = (0.5, 1.5) - def __init__(self, match): - super().__init__(match) - self.item = match.group(1) - def items(self): for gallery in self.galleries(): gallery["_extractor"] = PornpicsGalleryExtractor @@ -60,12 +56,12 @@ class PornpicsExtractor(Extractor): class PornpicsGalleryExtractor(PornpicsExtractor, GalleryExtractor): """Extractor for pornpics galleries""" - pattern = BASE_PATTERN + r"(/galleries/(?:[^/?#]+-)?(\d+))" + pattern = BASE_PATTERN + r"/galleries/((?:[^/?#]+-)?(\d+))" example = "https://www.pornpics.com/galleries/TITLE-12345/" def __init__(self, match): - PornpicsExtractor.__init__(self, match) - self.gallery_id = match.group(2) + url = "{}/galleries/{}/".format(self.root, match.group(1)) + GalleryExtractor.__init__(self, match, url) items = GalleryExtractor.items @@ -73,7 +69,7 @@ class PornpicsGalleryExtractor(PornpicsExtractor, GalleryExtractor): extr = text.extract_from(page) return { - "gallery_id": text.parse_int(self.gallery_id), + "gallery_id": text.parse_int(self.groups[1]), "slug" : extr("/galleries/", "/").rpartition("-")[0], "title" : text.unescape(extr("