From e2e73b5c65593ec0a5e685663e6ec0f4aaffc1f1 Mon Sep 17 00:00:00 2001 From: msm595 Date: Sat, 25 Jan 2025 21:36:16 -0500 Subject: [PATCH] [ie/patreon] Extract attachment filename as `alt_title` (#12000) Authored by: msm595 --- yt_dlp/extractor/patreon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/patreon.py b/yt_dlp/extractor/patreon.py index a0e831a5ce..7794cae6c0 100644 --- a/yt_dlp/extractor/patreon.py +++ b/yt_dlp/extractor/patreon.py @@ -63,6 +63,7 @@ class PatreonIE(PatreonBaseIE): 'info_dict': { 'id': '743933', 'ext': 'mp3', + 'alt_title': 'cd166.mp3', 'title': 'Episode 166: David Smalley of Dogma Debate', 'description': 'md5:34d207dd29aa90e24f1b3f58841b81c7', 'uploader': 'Cognitive Dissonance Podcast', @@ -280,7 +281,7 @@ def _real_extract(self, url): video_id = self._match_id(url) post = self._call_api( f'posts/{video_id}', video_id, query={ - 'fields[media]': 'download_url,mimetype,size_bytes', + 'fields[media]': 'download_url,mimetype,size_bytes,file_name', 'fields[post]': 'comment_count,content,embed,image,like_count,post_file,published_at,title,current_user_can_view', 'fields[user]': 'full_name,url', 'fields[post_tag]': 'value', @@ -317,6 +318,7 @@ def _real_extract(self, url): 'ext': ext, 'filesize': size_bytes, 'url': download_url, + 'alt_title': traverse_obj(media_attributes, ('file_name', {str})), }) elif include_type == 'user':