From a34cebc25320e5efe3740249dd5de50e74beb706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 30 Jan 2018 22:14:09 +0100 Subject: [PATCH] [luscious] jump to first image if cover does not link to it --- gallery_dl/extractor/luscious.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/luscious.py b/gallery_dl/extractor/luscious.py index 78bc7fa4..af6e2e81 100644 --- a/gallery_dl/extractor/luscious.py +++ b/gallery_dl/extractor/luscious.py @@ -35,13 +35,14 @@ class LusciousAlbumExtractor(AsynchronousExtractor): ("https://www.luscious.net/albums/okinami_277031/", None), ("https://members.luscious.net/albums/okinami_277031/", None), ] + root = "https://luscious.net" def __init__(self, match): AsynchronousExtractor.__init__(self) self.gpart, self.gid = match.groups() def items(self): - url = "https://luscious.net/albums/" + self.gpart + "/" + url = "{}/albums/{}/".format(self.root, self.gpart) page = self.request(url).text data = self.get_metadata(page) yield Message.Version, 1 @@ -68,15 +69,22 @@ class LusciousAlbumExtractor(AsynchronousExtractor): data["artist"] = None return data - def get_images(self, page): + def get_images(self, page, extr=text.extract): """Collect image-urls and -metadata""" - extr = text.extract num = 1 pos = page.find('
') url = extr(page, '