From 96bb2b16303d8d9c14f3f8785cf4ef5df0a0fd1f Mon Sep 17 00:00:00 2001 From: NecRaul Date: Wed, 11 Jun 2025 04:06:16 +0400 Subject: [PATCH] Fix Archived.moe redirection issue Unless the board is /b/ (in which case redirection works fine), remove the characters of the filename portion of the url until filename portion of the url is 13 characters long (epoch millis). --- gallery_dl/extractor/foolfuuka.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gallery_dl/extractor/foolfuuka.py b/gallery_dl/extractor/foolfuuka.py index 5f90afc1..8a0b9e5d 100644 --- a/gallery_dl/extractor/foolfuuka.py +++ b/gallery_dl/extractor/foolfuuka.py @@ -36,6 +36,13 @@ class FoolfuukaExtractor(BaseExtractor): url = media["media_link"] if not url and "remote_media_link" in media: + if "/b/" not in media["remote_media_link"] and \ + media["remote_media_link"].startswith("https://archived.moe/"): + filename = media["media"].rpartition(".")[0] + if len(filename) > 13: + filename_remainder = len(filename) - 13 + remote_media_link = media["remote_media_link"].replace(filename, filename[:-filename_remainder]) + media["remote_media_link"] = remote_media_link url = self.remote(media) if url and url[0] == "/": url = self.root + url