mirror of https://github.com/yt-dlp/yt-dlp.git
Compare commits
3 Commits
dcd9539c3d
...
b8e1c52459
Author | SHA1 | Date |
---|---|---|
sepro | b8e1c52459 | |
sepro | 46f4c80bc3 | |
sepro | baceaa1f2f |
|
@ -36,7 +36,7 @@ class SampleFocusIE(InfoExtractor):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id, impersonate=True)
|
||||||
|
|
||||||
sample_id = self._search_regex(
|
sample_id = self._search_regex(
|
||||||
r'<input[^>]+id=(["\'])sample_id\1[^>]+value=(?:["\'])(?P<id>\d+)',
|
r'<input[^>]+id=(["\'])sample_id\1[^>]+value=(?:["\'])(?P<id>\d+)',
|
||||||
|
@ -82,7 +82,15 @@ class SampleFocusIE(InfoExtractor):
|
||||||
return {
|
return {
|
||||||
'id': sample_id,
|
'id': sample_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
|
'formats': [{
|
||||||
'url': mp3_url,
|
'url': mp3_url,
|
||||||
|
'ext': 'mp3',
|
||||||
|
'vcodec': 'none',
|
||||||
|
'acodec': 'mp3',
|
||||||
|
'http_headers': {
|
||||||
|
'Referer': url,
|
||||||
|
},
|
||||||
|
}],
|
||||||
'display_id': display_id,
|
'display_id': display_id,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'uploader': uploader,
|
'uploader': uploader,
|
||||||
|
|
|
@ -5007,10 +5007,10 @@ class YoutubeTabBaseInfoExtractor(YoutubeBaseInfoExtractor):
|
||||||
yield self.url_result(
|
yield self.url_result(
|
||||||
f'https://www.youtube.com/shorts/{video_id}',
|
f'https://www.youtube.com/shorts/{video_id}',
|
||||||
ie=YoutubeIE, video_id=video_id,
|
ie=YoutubeIE, video_id=video_id,
|
||||||
**traverse_obj(renderer, {
|
**traverse_obj(renderer, ('overlayMetadata', {
|
||||||
'title': ('overlayMetadata', 'primaryText', 'content', {str}),
|
'title': ('primaryText', 'content', {str}),
|
||||||
'view_count': ('overlayMetadata', 'secondaryText', 'content', {parse_count}),
|
'view_count': ('secondaryText', 'content', {parse_count}),
|
||||||
}),
|
})),
|
||||||
thumbnails=self._extract_thumbnails(renderer, 'thumbnail', final_key='sources'))
|
thumbnails=self._extract_thumbnails(renderer, 'thumbnail', final_key='sources'))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue