aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsm595 <msm595@users.noreply.github.com>2025-01-25 21:36:16 -0500
committerGitHub <noreply@github.com>2025-01-26 02:36:16 +0000
commite2e73b5c65593ec0a5e685663e6ec0f4aaffc1f1 (patch)
treed851735d69d74433cba5f3ad3da869b0d6f2e65f
parent13825ab77815ee6e1603abbecbb9f3795057b93c (diff)
[ie/patreon] Extract attachment filename as `alt_title` (#12000)
Authored by: msm595
-rw-r--r--yt_dlp/extractor/patreon.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/extractor/patreon.py b/yt_dlp/extractor/patreon.py
index a0e831a5c..7794cae6c 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 @@ class PatreonIE(PatreonBaseIE):
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 @@ class PatreonIE(PatreonBaseIE):
'ext': ext,
'filesize': size_bytes,
'url': download_url,
+ 'alt_title': traverse_obj(media_attributes, ('file_name', {str})),
})
elif include_type == 'user':