From 78d83345d3957309d3be58268a48a077e3b78052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 13 Jun 2022 14:19:40 +0200 Subject: [PATCH] [cyberdrop] add fallback URLs (#2668) --- gallery_dl/extractor/cyberdrop.py | 5 +++-- gallery_dl/extractor/lolisafe.py | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/cyberdrop.py b/gallery_dl/extractor/cyberdrop.py index 1afaac86..7a79eca6 100644 --- a/gallery_dl/extractor/cyberdrop.py +++ b/gallery_dl/extractor/cyberdrop.py @@ -48,10 +48,11 @@ class CyberdropAlbumExtractor(lolisafe.LolisafeAlbumExtractor): files = [] append = files.append while True: - url = extr('id="file" href="', '"') + url = text.unescape(extr('id="file" href="', '"')) if not url: break - append({"file": text.unescape(url)}) + append({"file": url, + "_fallback": (self.root + url[url.find("/", 8):],)}) return files, { "album_id" : self.album_id, diff --git a/gallery_dl/extractor/lolisafe.py b/gallery_dl/extractor/lolisafe.py index f3bd5d89..2aea44c3 100644 --- a/gallery_dl/extractor/lolisafe.py +++ b/gallery_dl/extractor/lolisafe.py @@ -85,6 +85,8 @@ class LolisafeAlbumExtractor(LolisafeExtractor): yield Message.Directory, data for data["num"], file in enumerate(files, 1): url = file["file"] + if "_fallback" in file: + data["_fallback"] = file["_fallback"] text.nameext_from_url(url, data) data["name"], sep, data["id"] = data["filename"].rpartition("-")