mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-06-21 18:24:47 +00:00
Compare commits
No commits in common. "707537a03946fbc5707e22be429545c670cd8ec2" and "cb309b3293c9919cfb55f5d9ffa2c8c109a5f1eb" have entirely different histories.
707537a039
...
cb309b3293
@ -209,7 +209,7 @@ class CurlFD(ExternalFD):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
cls.exe = path
|
cls.exe = path
|
||||||
cls._curl_version = version_tuple(parts[1], lenient=True)
|
cls._curl_version = version_tuple(parts[1])
|
||||||
return path
|
return path
|
||||||
|
|
||||||
def _make_cmd(self, tmpfilename, info_dict):
|
def _make_cmd(self, tmpfilename, info_dict):
|
||||||
|
|||||||
@ -65,9 +65,8 @@ class PatreonBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
class PatreonIE(PatreonBaseIE):
|
class PatreonIE(PatreonBaseIE):
|
||||||
IE_NAME = 'patreon'
|
IE_NAME = 'patreon'
|
||||||
_VALID_URL = r'https?://(?:www\.)?patreon\.com/(?:creation\?hid=|(?:[^/?#]+/)?posts/(?:[\w-]+-)?)(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?patreon\.com/(?:creation\?hid=|posts/(?:[\w-]+-)?)(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
# FIXME: Fails due to no description extracted
|
|
||||||
'url': 'http://www.patreon.com/creation?hid=743933',
|
'url': 'http://www.patreon.com/creation?hid=743933',
|
||||||
'md5': 'e25505eec1053a6e6813b8ed369875cc',
|
'md5': 'e25505eec1053a6e6813b8ed369875cc',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -108,17 +107,17 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
'id': 'SU4fj_aEMVw',
|
'id': 'SU4fj_aEMVw',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'I\'m on Patreon!',
|
'title': 'I\'m on Patreon!',
|
||||||
'uploader': 'Traci Oden',
|
'uploader': 'TraciJHines',
|
||||||
'thumbnail': 're:^https?://.*$',
|
'thumbnail': 're:^https?://.*$',
|
||||||
'upload_date': '20150211',
|
'upload_date': '20150211',
|
||||||
'description': 'md5:8af6425f50bd46fbf29f3db0fc3a8364',
|
'description': 'md5:8af6425f50bd46fbf29f3db0fc3a8364',
|
||||||
'uploader_id': '@TraciOden',
|
'uploader_id': '@TraciHinesMusic',
|
||||||
'categories': ['Entertainment'],
|
'categories': ['Entertainment'],
|
||||||
'duration': 282,
|
'duration': 282,
|
||||||
'view_count': int,
|
'view_count': int,
|
||||||
'tags': 'count:39',
|
'tags': 'count:39',
|
||||||
'age_limit': 0,
|
'age_limit': 0,
|
||||||
'channel': 'Traci Oden',
|
'channel': 'TraciJHines',
|
||||||
'channel_url': 'https://www.youtube.com/channel/UCGLim4T2loE5rwCMdpCIPVg',
|
'channel_url': 'https://www.youtube.com/channel/UCGLim4T2loE5rwCMdpCIPVg',
|
||||||
'live_status': 'not_live',
|
'live_status': 'not_live',
|
||||||
'like_count': int,
|
'like_count': int,
|
||||||
@ -126,7 +125,7 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
'availability': 'public',
|
'availability': 'public',
|
||||||
'channel_follower_count': int,
|
'channel_follower_count': int,
|
||||||
'playable_in_embed': True,
|
'playable_in_embed': True,
|
||||||
'uploader_url': 'https://www.youtube.com/@TraciOden',
|
'uploader_url': 'https://www.youtube.com/@TraciHinesMusic',
|
||||||
'comment_count': int,
|
'comment_count': int,
|
||||||
'channel_is_verified': True,
|
'channel_is_verified': True,
|
||||||
'chapters': 'count:4',
|
'chapters': 'count:4',
|
||||||
@ -158,7 +157,6 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
},
|
},
|
||||||
'skip': 'Patron-only content',
|
'skip': 'Patron-only content',
|
||||||
}, {
|
}, {
|
||||||
# FIXME: Fails due to no description extracted
|
|
||||||
# m3u8 video (https://github.com/yt-dlp/yt-dlp/issues/2277)
|
# m3u8 video (https://github.com/yt-dlp/yt-dlp/issues/2277)
|
||||||
'url': 'https://www.patreon.com/posts/video-sketchbook-32452882',
|
'url': 'https://www.patreon.com/posts/video-sketchbook-32452882',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -222,7 +220,6 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
'channel_id': '2147162',
|
'channel_id': '2147162',
|
||||||
'uploader_url': 'https://www.patreon.com/yaboyroshi',
|
'uploader_url': 'https://www.patreon.com/yaboyroshi',
|
||||||
},
|
},
|
||||||
'skip': 'HTTP Error 401 for m3u8 request; site now requires login to play the video',
|
|
||||||
}, {
|
}, {
|
||||||
# NSFW vimeo embed URL
|
# NSFW vimeo embed URL
|
||||||
'url': 'https://www.patreon.com/posts/4k-spiderman-4k-96414599',
|
'url': 'https://www.patreon.com/posts/4k-spiderman-4k-96414599',
|
||||||
@ -245,7 +242,6 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
},
|
},
|
||||||
'params': {'skip_download': 'm3u8'},
|
'params': {'skip_download': 'm3u8'},
|
||||||
'expected_warnings': ['Failed to parse XML: not well-formed'],
|
'expected_warnings': ['Failed to parse XML: not well-formed'],
|
||||||
'skip': 'Video removed',
|
|
||||||
}, {
|
}, {
|
||||||
# multiple attachments/embeds
|
# multiple attachments/embeds
|
||||||
'url': 'https://www.patreon.com/posts/holy-wars-solos-100601977',
|
'url': 'https://www.patreon.com/posts/holy-wars-solos-100601977',
|
||||||
@ -289,7 +285,6 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
},
|
},
|
||||||
'params': {'getcomments': True},
|
'params': {'getcomments': True},
|
||||||
}, {
|
}, {
|
||||||
# FIXME: Error: No supported media found in this post
|
|
||||||
# Inlined media in post; uses _extract_from_media_api
|
# Inlined media in post; uses _extract_from_media_api
|
||||||
'url': 'https://www.patreon.com/posts/scottfalco-146966245',
|
'url': 'https://www.patreon.com/posts/scottfalco-146966245',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -309,26 +304,6 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
'timestamp': 1767061800,
|
'timestamp': 1767061800,
|
||||||
'upload_date': '20251230',
|
'upload_date': '20251230',
|
||||||
},
|
},
|
||||||
}, {
|
|
||||||
# FIXME: need to extract description
|
|
||||||
'url': 'https://www.patreon.com/Insanimate/posts/meatcanyon-in-142663524',
|
|
||||||
'md5': '132332e3bb345f75d8b471242346dee6',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '142663524',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Meatcanyon in Playground',
|
|
||||||
'uploader': 'Insanimate',
|
|
||||||
'uploader_id': '2828146',
|
|
||||||
'uploader_url': 'https://www.patreon.com/Insanimate',
|
|
||||||
'channel_id': '6260877',
|
|
||||||
'channel_url': 'https://www.patreon.com/Insanimate',
|
|
||||||
'channel_follower_count': int,
|
|
||||||
'comment_count': int,
|
|
||||||
'like_count': int,
|
|
||||||
'thumbnail': 're:^https?://.*$',
|
|
||||||
'timestamp': 1762101034,
|
|
||||||
'upload_date': '20251102',
|
|
||||||
},
|
|
||||||
}]
|
}]
|
||||||
_RETURN_TYPE = 'video'
|
_RETURN_TYPE = 'video'
|
||||||
_HTTP_HEADERS = {
|
_HTTP_HEADERS = {
|
||||||
@ -382,7 +357,7 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
post = self._call_api(
|
post = self._call_api(
|
||||||
f'posts/{video_id}', video_id, query={
|
f'posts/{video_id}', video_id, query={
|
||||||
'fields[media]': 'download_url,mimetype,size_bytes,file_name',
|
'fields[media]': 'download_url,mimetype,size_bytes,file_name',
|
||||||
'fields[post]': 'comment_count,content,content_teaser_text,cleaned_teaser_text,embed,image,like_count,post_file,published_at,title,current_user_can_view',
|
'fields[post]': 'comment_count,content,embed,image,like_count,post_file,published_at,title,current_user_can_view',
|
||||||
'fields[user]': 'full_name,url',
|
'fields[user]': 'full_name,url',
|
||||||
'fields[post_tag]': 'value',
|
'fields[post_tag]': 'value',
|
||||||
'fields[campaign]': 'url,name,patron_count',
|
'fields[campaign]': 'url,name,patron_count',
|
||||||
@ -392,7 +367,7 @@ class PatreonIE(PatreonBaseIE):
|
|||||||
attributes = post['data']['attributes']
|
attributes = post['data']['attributes']
|
||||||
info = traverse_obj(attributes, {
|
info = traverse_obj(attributes, {
|
||||||
'title': ('title', {str.strip}),
|
'title': ('title', {str.strip}),
|
||||||
'description': (('content', 'content_teaser_text', 'cleaned_teaser_text'), {clean_html}, any),
|
'description': ('content', {clean_html}),
|
||||||
'thumbnail': ('image', ('large_url', 'url'), {url_or_none}, any),
|
'thumbnail': ('image', ('large_url', 'url'), {url_or_none}, any),
|
||||||
'timestamp': ('published_at', {parse_iso8601}),
|
'timestamp': ('published_at', {parse_iso8601}),
|
||||||
'like_count': ('like_count', {int_or_none}),
|
'like_count': ('like_count', {int_or_none}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user