From dd67e24aa9cf55d132b4e905c5e018a6ee309bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 25 Dec 2021 16:49:42 +0100 Subject: [PATCH] [lolisafe] include file ID in filenames More precisely, it now splits the full 'filename' into 'name' and 'id' instead of overwriting 'filename'. The format string stays the same as before. Use '{name}.{extension}' to restore the old behavior. before: - filename: foobar - id : 12345 now: - filename: foobar-12345 - name : foobar - id : 12345 --- gallery_dl/extractor/lolisafe.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/lolisafe.py b/gallery_dl/extractor/lolisafe.py index f8fbe4de..cdaf22b0 100644 --- a/gallery_dl/extractor/lolisafe.py +++ b/gallery_dl/extractor/lolisafe.py @@ -36,8 +36,9 @@ class LolisafelbumExtractor(LolisafeExtractor): "album_id": "Lktg9Keq", "album_name": 'test テスト "&>', "count": 1, - "filename": 'test-テスト-"&>', + "filename": 'test-テスト-"&>-QjgneIQv', "id": "QjgneIQv", + "name": 'test-テスト-"&>', "num": int, }, }), @@ -64,10 +65,7 @@ class LolisafelbumExtractor(LolisafeExtractor): for data["num"], file in enumerate(files, 1): url = file["file"] text.nameext_from_url(url, data) - data["filename"], sep, data["id"] = \ - data["filename"].rpartition("-") - if not sep: - data["filename"] = data["id"] + data["name"], sep, data["id"] = data["filename"].rpartition("-") yield Message.Url, url, data def fetch_album(self, album_id):