From 575e5df5390bd3bfa5e956f1ab53aeddb1942879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 7 Aug 2024 08:26:23 +0200 Subject: [PATCH] [hotleak] fix AttributeError (#5950) fixes regression introduced in 0432e057 --- gallery_dl/extractor/hotleak.py | 2 +- test/results/hotleak.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/hotleak.py b/gallery_dl/extractor/hotleak.py index 34fbabd8..ddfc54b3 100644 --- a/gallery_dl/extractor/hotleak.py +++ b/gallery_dl/extractor/hotleak.py @@ -23,7 +23,7 @@ class HotleakExtractor(Extractor): def items(self): for post in self.posts(): - if self.type == "photo": + if not post["url"].startswith("ytdl:"): post["url"] = ( post["url"] .replace("/storage/storage/", "/storage/") diff --git a/test/results/hotleak.py b/test/results/hotleak.py index 4e577d11..7305180c 100644 --- a/test/results/hotleak.py +++ b/test/results/hotleak.py @@ -13,20 +13,20 @@ __tests__ = ( "#url" : "https://hotleak.vip/kaiyakawaii/photo/1617145", "#category": ("", "hotleak", "post"), "#class" : hotleak.HotleakPostExtractor, - "#pattern" : r"https://hotleak\.vip/storage/images/3625/1617145/fefdd5988dfcf6b98cc9e11616018868\.jpg", + "#urls" : "https://image-cdn.hotleak.vip/storage/images/e98/18ad68/18ad68.webp", "id" : 1617145, "creator" : "kaiyakawaii", "type" : "photo", - "filename" : "fefdd5988dfcf6b98cc9e11616018868", - "extension": "jpg", + "filename" : "18ad68", + "extension": "webp", }, { "#url" : "https://hotleak.vip/lilmochidoll/video/1625538", "#category": ("", "hotleak", "post"), "#class" : hotleak.HotleakPostExtractor, - "#pattern" : r"ytdl:https://cdn8-leak\.camhdxx\.com/1661/1625538/index\.m3u8", + "#pattern" : r"ytdl:https://cdn\d+-leak\.camhdxx\.com/.+,\d+/1661/1625538/index\.m3u8", "id" : 1625538, "creator" : "lilmochidoll",