From 4807bc215cdc36ef3216d6f39afac7cfb8afeef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 22 Mar 2025 09:46:08 +0100 Subject: [PATCH] [subscribestar] extract 'title' metadata (#7219) --- gallery_dl/extractor/subscribestar.py | 2 ++ test/results/subscribestar.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/gallery_dl/extractor/subscribestar.py b/gallery_dl/extractor/subscribestar.py index 6c439418..b8025180 100644 --- a/gallery_dl/extractor/subscribestar.py +++ b/gallery_dl/extractor/subscribestar.py @@ -39,6 +39,8 @@ class SubscribestarExtractor(Extractor): for post_html in self.posts(): media = self._media_from_post(post_html) data = self._data_from_post(post_html) + data["title"] = text.unescape(text.extr( + data["content"], "

", "

")) yield Message.Directory, data for num, item in enumerate(media, 1): item.update(data) diff --git a/test/results/subscribestar.py b/test/results/subscribestar.py index 7779dd55..66474ff1 100644 --- a/test/results/subscribestar.py +++ b/test/results/subscribestar.py @@ -24,6 +24,7 @@ __tests__ = ( "id" : int, "num" : int, "post_id" : int, + "title" : str, "type" : r"re:image|video|attachment", "url" : str, "?pinned" : bool, @@ -66,6 +67,7 @@ __tests__ = ( "num" : 1, "pinned" : False, "post_id" : 102468, + "title" : "Brand Guidelines and Assets", "type" : "image", "width" : 700, }, @@ -85,6 +87,7 @@ __tests__ = ( "name" : "Training for freelancers - Fiverr.pdf", "num" : 2, "post_id" : 920015, + "title" : "", "type" : "attachment", },