From a46f7981ee80275f3051e79f26048e1f4c467019 Mon Sep 17 00:00:00 2001 From: Wyoh Knott Date: Thu, 2 Jan 2025 15:34:12 +0100 Subject: [PATCH] [subscribestar] Fix attachment download and add support for audio type - We change the text.extr 3rd argument to match current structure ('class="post-edit_form"') - We add support for uploads-audios based on a similar structure as the attachment type: - id = data-upload-id - name = audio_preview-title - url = src - type = audio Fix #6721 --- gallery_dl/extractor/subscribestar.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/subscribestar.py b/gallery_dl/extractor/subscribestar.py index 7c760ac6..b22310c3 100644 --- a/gallery_dl/extractor/subscribestar.py +++ b/gallery_dl/extractor/subscribestar.py @@ -98,7 +98,7 @@ class SubscribestarExtractor(Extractor): media.append(item) attachments = text.extr( - html, 'class="uploads-docs"', 'data-role="post-edit_form"') + html, 'class="uploads-docs"', 'class="post-edit_form"') if attachments: for att in attachments.split('class="doc_preview"')[1:]: media.append({ @@ -110,6 +110,19 @@ class SubscribestarExtractor(Extractor): "type": "attachment", }) + audios = text.extr( + html, 'class="uploads-audios"', 'class="post-edit_form"') + if audios: + for audio in audios.split('class="audio_preview-data"')[1:]: + media.append({ + "id" : text.parse_int(text.extr( + audio, 'data-upload-id="', '"')), + "name": text.unescape(text.extr( + audio, 'audio_preview-title">', '<')), + "url" : text.unescape(text.extr(audio, 'src="', '"')), + "type": "audio", + }) + return media def _data_from_post(self, html):