projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[yourporn] Fix extraction and extract duration (closes #18815, closes #18852)
[youtube-dl]
/
youtube_dl
/
extractor
/
patreon.py
diff --git
a/youtube_dl/extractor/patreon.py
b/youtube_dl/extractor/patreon.py
index 6f73ed68d8c68f83611943fea54416897db64429..426dd812158686a4a86e06c0846dd257fcee6748 100644
(file)
--- a/
youtube_dl/extractor/patreon.py
+++ b/
youtube_dl/extractor/patreon.py
@@
-104,16
+104,18
@@
class PatreonIE(InfoExtractor):
'comment_count': int_or_none(attributes.get('comment_count')),
}
'comment_count': int_or_none(attributes.get('comment_count')),
}
+ def add_file(file_data):
+ file_url = file_data.get('url')
+ if file_url:
+ info.update({
+ 'url': file_url,
+ 'ext': determine_ext(file_data.get('name'), 'mp3'),
+ })
+
for i in post.get('included', []):
i_type = i.get('type')
if i_type == 'attachment':
for i in post.get('included', []):
i_type = i.get('type')
if i_type == 'attachment':
- attachment_attributes = i.get('attributes') or {}
- attachment_url = attachment_attributes.get('url')
- if attachment_url:
- info.update({
- 'url': attachment_url,
- 'ext': determine_ext(attachment_attributes.get('name'), 'mp3'),
- })
+ add_file(i.get('attributes') or {})
elif i_type == 'user':
user_attributes = i.get('attributes')
if user_attributes:
elif i_type == 'user':
user_attributes = i.get('attributes')
if user_attributes:
@@
-122,6
+124,9
@@
class PatreonIE(InfoExtractor):
'uploader_url': user_attributes.get('url'),
})
'uploader_url': user_attributes.get('url'),
})
+ if not info.get('url'):
+ add_file(attributes.get('post_file') or {})
+
if not info.get('url'):
info.update({
'_type': 'url',
if not info.get('url'):
info.update({
'_type': 'url',