mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
parent
8e25d624df
commit
8a2d992389
1 changed files with 3 additions and 2 deletions
|
@ -479,7 +479,7 @@ def process_formats(formats):
|
||||||
for f in formats:
|
for f in formats:
|
||||||
f.setdefault('http_headers', {})['User-Agent'] = 'facebookexternalhit/1.1'
|
f.setdefault('http_headers', {})['User-Agent'] = 'facebookexternalhit/1.1'
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats, ('res', 'quality'))
|
||||||
|
|
||||||
def extract_relay_data(_filter):
|
def extract_relay_data(_filter):
|
||||||
return self._parse_json(self._search_regex(
|
return self._parse_json(self._search_regex(
|
||||||
|
@ -687,13 +687,14 @@ def parse_attachment(attachment, key='media'):
|
||||||
for src_type in ('src', 'src_no_ratelimit'):
|
for src_type in ('src', 'src_no_ratelimit'):
|
||||||
src = f[0].get('%s_%s' % (quality, src_type))
|
src = f[0].get('%s_%s' % (quality, src_type))
|
||||||
if src:
|
if src:
|
||||||
preference = -10 if format_id == 'progressive' else 0
|
preference = -10 if format_id == 'progressive' else -1
|
||||||
if quality == 'hd':
|
if quality == 'hd':
|
||||||
preference += 5
|
preference += 5
|
||||||
formats.append({
|
formats.append({
|
||||||
'format_id': '%s_%s_%s' % (format_id, quality, src_type),
|
'format_id': '%s_%s_%s' % (format_id, quality, src_type),
|
||||||
'url': src,
|
'url': src,
|
||||||
'quality': preference,
|
'quality': preference,
|
||||||
|
'height': 720 if quality == 'hd' else None
|
||||||
})
|
})
|
||||||
extract_dash_manifest(f[0], formats)
|
extract_dash_manifest(f[0], formats)
|
||||||
subtitles_src = f[0].get('subtitles_src')
|
subtitles_src = f[0].get('subtitles_src')
|
||||||
|
|
Loading…
Reference in a new issue