mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 22:34:01 -07:00
fallback to non-encoded video_url in case of non-complete data
This commit is contained in:
parent
025c0fec0b
commit
07da420536
1 changed files with 16 additions and 0 deletions
|
@ -198,6 +198,14 @@ class KtPlayerExtractor(InfoExtractor):
|
|||
height = int_or_none(res[:-1])
|
||||
if height:
|
||||
default_format['height'] = height
|
||||
else:
|
||||
preview_height = self._html_search_regex(
|
||||
r"""preview_height1:\s+'(.+?)'""", flashdata, 'preview_height', default=None, fatal=False)
|
||||
if preview_height:
|
||||
height = int_or_none(preview_height)
|
||||
if height:
|
||||
default_format['height'] = height
|
||||
default_format['format_id'] = preview_height + 'p'
|
||||
|
||||
formats = [default_format]
|
||||
video_alt_url = KtPlayerHelper.get_alt_url(flashdata)
|
||||
|
@ -216,6 +224,14 @@ class KtPlayerExtractor(InfoExtractor):
|
|||
|
||||
formats.append(alt_format)
|
||||
|
||||
if not ext and len(formats) == 1:
|
||||
# this might indicate the decoded URL is not correct but the original URL might work
|
||||
# add it into formats
|
||||
formats.append({
|
||||
'format_id': 'fallback',
|
||||
'url': KtPlayerHelper.get_raw_url(flashdata),
|
||||
})
|
||||
|
||||
description = self._og_search_title(webpage, fatal=False)
|
||||
duration = self._html_search_regex(
|
||||
self._DURATION_RE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue