mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-06-20 17:54:50 +00:00
Compare commits
3 Commits
943083edcd
...
c723c4e5e7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c723c4e5e7 | ||
|
|
148a1eb4c5 | ||
|
|
85c8a405e3 |
@ -314,6 +314,20 @@ class TestInfoExtractor(unittest.TestCase):
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
# test thumbnail_url key without URL scheme
|
||||||
|
r'''
|
||||||
|
<script type="application/ld+json">
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "VideoObject",
|
||||||
|
"thumbnail_url": "//www.nobelprize.org/images/12693-landscape-medium-gallery.jpg"
|
||||||
|
}</script>''',
|
||||||
|
{
|
||||||
|
'thumbnails': [{'url': 'https://www.nobelprize.org/images/12693-landscape-medium-gallery.jpg'}],
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
for html, expected_dict, search_json_ld_kwargs in _TESTS:
|
for html, expected_dict, search_json_ld_kwargs in _TESTS:
|
||||||
expect_dict(
|
expect_dict(
|
||||||
|
|||||||
@ -1675,9 +1675,9 @@ class InfoExtractor:
|
|||||||
'ext': mimetype2ext(e.get('encodingFormat')),
|
'ext': mimetype2ext(e.get('encodingFormat')),
|
||||||
'title': unescapeHTML(e.get('name')),
|
'title': unescapeHTML(e.get('name')),
|
||||||
'description': unescapeHTML(e.get('description')),
|
'description': unescapeHTML(e.get('description')),
|
||||||
'thumbnails': [{'url': unescapeHTML(url)}
|
'thumbnails': traverse_obj(e, (('thumbnailUrl', 'thumbnailURL', 'thumbnail_url'), (None, ...), {
|
||||||
for url in variadic(traverse_obj(e, 'thumbnailUrl', 'thumbnailURL'))
|
'url': ({str}, {unescapeHTML}, {self._proto_relative_url}, {url_or_none}),
|
||||||
if url_or_none(url)],
|
})),
|
||||||
'duration': parse_duration(e.get('duration')),
|
'duration': parse_duration(e.get('duration')),
|
||||||
'timestamp': unified_timestamp(e.get('uploadDate')),
|
'timestamp': unified_timestamp(e.get('uploadDate')),
|
||||||
# author can be an instance of 'Organization' or 'Person' types.
|
# author can be an instance of 'Organization' or 'Person' types.
|
||||||
|
|||||||
@ -273,6 +273,8 @@ class OdnoklassnikiIE(InfoExtractor):
|
|||||||
return self._extract_desktop(smuggle_url(url, {'referrer': 'https://boosty.to'}))
|
return self._extract_desktop(smuggle_url(url, {'referrer': 'https://boosty.to'}))
|
||||||
elif error:
|
elif error:
|
||||||
raise ExtractorError(error, expected=True)
|
raise ExtractorError(error, expected=True)
|
||||||
|
elif '>Access to this video is restricted</div>' in webpage:
|
||||||
|
self.raise_login_required()
|
||||||
|
|
||||||
player = self._parse_json(
|
player = self._parse_json(
|
||||||
unescapeHTML(self._search_regex(
|
unescapeHTML(self._search_regex(
|
||||||
@ -429,7 +431,7 @@ class OdnoklassnikiIE(InfoExtractor):
|
|||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(
|
webpage = self._download_webpage(
|
||||||
f'http://m.ok.ru/video/{video_id}', video_id,
|
f'https://m.ok.ru/video/{video_id}', video_id,
|
||||||
note='Downloading mobile webpage')
|
note='Downloading mobile webpage')
|
||||||
|
|
||||||
error = self._search_regex(
|
error = self._search_regex(
|
||||||
|
|||||||
@ -236,7 +236,7 @@ class VimeoBaseInfoExtractor(InfoExtractor):
|
|||||||
for tt in (request.get('text_tracks') or []):
|
for tt in (request.get('text_tracks') or []):
|
||||||
subtitles.setdefault(tt['lang'], []).append({
|
subtitles.setdefault(tt['lang'], []).append({
|
||||||
'ext': 'vtt',
|
'ext': 'vtt',
|
||||||
'url': urljoin('https://vimeo.com', tt['url']),
|
'url': urljoin('https://player.vimeo.com/', tt['url']),
|
||||||
})
|
})
|
||||||
|
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user