final batch of sync test suite

This commit is contained in:
meeb 2020-12-09 19:32:23 +11:00
parent 60a726bb7c
commit c31ed0af28
10 changed files with 2419 additions and 1197 deletions

View File

@ -106,6 +106,8 @@ def get_best_video_format(media):
# Can't fallback
return False, False
video_formats = list(reversed(sorted(video_formats, key=lambda k: k['height'])))
source_resolution = media.source.source_resolution.strip().upper()
source_vcodec = media.source.source_vcodec
if not video_formats:
# Still no matches
return False, False
@ -114,8 +116,8 @@ def get_best_video_format(media):
if media.source.prefer_60fps and media.source.prefer_hdr:
for fmt in video_formats:
# Check for an exact match
if (media.source.source_resolution.strip().upper() == fmt['format'] and
media.source.source_vcodec == fmt['vcodec'] and
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
fmt['is_hdr'] and
fmt['is_60fps']):
# Exact match
@ -124,22 +126,61 @@ def get_best_video_format(media):
if media.source.can_fallback:
if not best_match:
for fmt in video_formats:
# Check for a codec, hdr and fps match but drop the resolution
if (media.source.source_vcodec == fmt['vcodec'] and
# Check for a resolution, hdr and fps match but drop the codec
if (source_resolution == fmt['format'] and
fmt['is_hdr'] and fmt['is_60fps']):
# Close match
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for hdr and fps match but drop the resolution and codec
if fmt['is_hdr'] and fmt['is_60fps']:
# Check for a codec, hdr and fps match but drop the resolution
if (source_vcodec == fmt['vcodec'] and
fmt['is_hdr'] and fmt['is_60fps']):
# Close match
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for fps match but drop the resolution and codec and hdr
if fmt['is_hdr'] and fmt['is_60fps']:
# Check for resolution, codec and 60fps match
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution and hdr match
if (source_resolution == fmt['format'] and
fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution and 60fps match
if (source_resolution == fmt['format'] and
fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution, codec and hdr match
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution and codec
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution
if source_resolution == fmt['format']:
exact_match, best_match = False, fmt
break
if not best_match:
@ -149,35 +190,67 @@ def get_best_video_format(media):
if media.source.prefer_60fps and not media.source.prefer_hdr:
for fmt in video_formats:
# Check for an exact match
if (media.source.source_resolution.strip().upper() == fmt['format'] and
media.source.source_vcodec == fmt['vcodec'] and
fmt['is_60fps']):
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
fmt['is_60fps'] and
not fmt['is_hdr']):
# Exact match
exact_match, best_match = True, fmt
break
if media.source.can_fallback:
if not best_match:
for fmt in video_formats:
# Check for a resolution and fps match but drop the codec
if (source_resolution == fmt['format'] and
fmt['is_60fps'] and
not fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for a codec and fps match but drop the resolution
if (media.source.source_vcodec == fmt['vcodec'] and
if (source_vcodec == fmt['vcodec'] and
fmt['is_60fps'] and
not fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for a codec and 60fps match
if (source_vcodec == fmt['vcodec'] and
fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for an fps match but drop the resolution and codec
if fmt['is_60fps']:
# Check for codec and resolution match bot drop 60fps
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
not fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for codec and resolution match only
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution
if source_resolution == fmt['format']:
exact_match, best_match = False, fmt
break
if not best_match:
# Match the highest resolution
exact_match, best_match = False, video_formats[0]
# Check for resolution + codec + hdr
if media.source.prefer_hdr and not media.source.prefer_60fps:
elif media.source.prefer_hdr and not media.source.prefer_60fps:
for fmt in video_formats:
# Check for an exact match
if (media.source.source_resolution.strip().upper() == fmt['format'] and
media.source.source_vcodec == fmt['vcodec'] and
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
fmt['is_hdr']):
# Exact match
exact_match, best_match = True, fmt
@ -185,43 +258,113 @@ def get_best_video_format(media):
if media.source.can_fallback:
if not best_match:
for fmt in video_formats:
# Check for a codec and hdr match but drop the resolution
if (media.source.source_vcodec == fmt['vcodec'] and
fmt['is_hdr']):
exact_match, best_match = True, fmt
# Check for a resolution and fps match but drop the codec
if (source_resolution == fmt['format'] and
fmt['is_hdr'] and
not fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for an hdr match but drop the resolution and codec
if fmt['is_hdr']:
# Check for a codec and fps match but drop the resolution
if (source_vcodec == fmt['vcodec'] and
fmt['is_hdr'] and
not fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for a codec and 60fps match
if (source_vcodec == fmt['vcodec'] and
fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for codec and resolution match bot drop hdr
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
not fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for codec and resolution match only
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution
if source_resolution == fmt['format']:
exact_match, best_match = False, fmt
break
if not best_match:
# Match the highest resolution
exact_match, best_match = False, video_formats[0]
# check for resolution + codec
if not media.source.prefer_hdr and not media.source.prefer_60fps:
elif not media.source.prefer_hdr and not media.source.prefer_60fps:
for fmt in video_formats:
# Check for an exact match
if (media.source.source_resolution.strip().upper() == fmt['format'] and
media.source.source_vcodec == fmt['vcodec'] and
not fmt['is_60fps']):
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
not fmt['is_60fps'] and
not fmt['is_hdr']):
# Exact match
exact_match, best_match = True, fmt
break
if media.source.can_fallback:
if not best_match:
for fmt in video_formats:
# Check for a codec match without 60fps and drop the resolution
if (media.source.source_vcodec == fmt['vcodec'] and
# Check for a resolution, hdr and fps match but drop the codec
if (source_resolution == fmt['format'] and
not fmt['is_hdr'] and not fmt['is_60fps']):
# Close match
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for a codec, hdr and fps match but drop the resolution
if (source_vcodec == fmt['vcodec'] and
not fmt['is_hdr'] and fmt['is_60fps']):
# Close match
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution, codec and hdr match
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
not fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution, codec and 60fps match
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec'] and
not fmt['is_60fps']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for a codec match but drop the resolution
if media.source.source_vcodec == fmt['vcodec']:
# Close match
# Check for resolution and codec
if (source_resolution == fmt['format'] and
source_vcodec == fmt['vcodec']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution and not hdr
if (source_resolution == fmt['format'] and
not fmt['is_hdr']):
exact_match, best_match = False, fmt
break
if not best_match:
for fmt in video_formats:
# Check for resolution
if source_resolution == fmt['format']:
exact_match, best_match = False, fmt
break
if not best_match:

View File

@ -344,9 +344,6 @@ def get_media_thumb_path(instance, filename):
return Path('thumbs') / prefix / filename
_metadata_cache = {}
class Media(models.Model):
'''
Media is a single piece of media, such as a single YouTube video linked to a
@ -551,14 +548,11 @@ class Media(models.Model):
@property
def loaded_metadata(self):
if self.pk in _metadata_cache:
return _metadata_cache[self.pk]
try:
unpacked_data = json.loads(self.metadata)
except Exception:
return json.loads(self.metadata)
except Exception as e:
print('!!!!', e)
return {}
_metadata_cache[self.pk] = unpacked_data
return _metadata_cache[self.pk]
@property
def url(self):

View File

@ -50,7 +50,8 @@ def map_task_to_instance(task):
try:
queue_uuid = uuid.UUID(task.queue)
try:
return Source.objects.get(pk=task.queue)
url = MODEL_URL_MAP.get(Source, None)
return Source.objects.get(pk=task.queue), url
except Source.DoesNotExist:
pass
except (TypeError, ValueError, AttributeError):

8
app/sync/testdata/README.md vendored Normal file
View File

@ -0,0 +1,8 @@
# metadata
This directory contains metadata extracted from some test YouTube videos with
youtube-dl.
They are used to test (with `sync/tests.py`) the format matchers in `sync/matching.py`
and are not otherwise used in TubeSync. Removing this directory will not break TubeSync
but will break test running.

342
app/sync/testdata/metadata.json vendored Normal file
View File

@ -0,0 +1,342 @@
{
"id":"no fancy stuff",
"upload_date":"20170911",
"license":null,
"creator":null,
"title":"no fancy stuff",
"alt_title":null,
"description":"no fancy stuff",
"categories":[],
"tags":[],
"subtitles":{},
"automatic_captions":{},
"duration":401.0,
"age_limit":0,
"annotations":null,
"chapters":null,
"formats":[
{
"format_id":"249",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":50,
"asr":48000,
"filesize":2579310,
"fps":null,
"height":null,
"tbr":59.781,
"width":null,
"vcodec":"none",
"format":"249 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"250",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":70,
"asr":48000,
"filesize":3362359,
"fps":null,
"height":null,
"tbr":78.829,
"width":null,
"vcodec":"none",
"format":"250 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"140",
"player_url":null,
"ext":"m4a",
"format_note":"tiny",
"acodec":"mp4a.40.2",
"abr":128,
"container":"m4a_dash",
"asr":44100,
"filesize":6365654,
"fps":null,
"height":null,
"tbr":128.191,
"width":null,
"vcodec":"none",
"format":"140 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"251",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":160,
"asr":48000,
"filesize":6669827,
"fps":null,
"height":null,
"tbr":156.344,
"width":null,
"vcodec":"none",
"format":"251 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"278",
"player_url":null,
"ext":"webm",
"height":144,
"format_note":"144p",
"container":"webm",
"vcodec":"vp9",
"asr":null,
"filesize":4080226,
"fps":24,
"tbr":101.676,
"width":256,
"acodec":"none",
"format":"278 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"160",
"player_url":null,
"ext":"mp4",
"height":144,
"format_note":"144p",
"vcodec":"avc1.4d400c",
"asr":null,
"filesize":2277074,
"fps":24,
"tbr":115.609,
"width":256,
"acodec":"none",
"format":"160 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"242",
"player_url":null,
"ext":"webm",
"height":240,
"format_note":"240p",
"vcodec":"vp9",
"asr":null,
"filesize":6385245,
"fps":24,
"tbr":229.335,
"width":426,
"acodec":"none",
"format":"242 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"133",
"player_url":null,
"ext":"mp4",
"height":240,
"format_note":"240p",
"vcodec":"avc1.4d4015",
"asr":null,
"filesize":4049342,
"fps":24,
"tbr":268.066,
"width":426,
"acodec":"none",
"format":"133 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"243",
"player_url":null,
"ext":"webm",
"height":360,
"format_note":"360p",
"vcodec":"vp9",
"asr":null,
"filesize":11534488,
"fps":24,
"tbr":431.644,
"width":640,
"acodec":"none",
"format":"243 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"134",
"player_url":null,
"ext":"mp4",
"height":360,
"format_note":"360p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":9802128,
"fps":24,
"tbr":682.225,
"width":640,
"acodec":"none",
"format":"134 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"244",
"player_url":null,
"ext":"webm",
"height":480,
"format_note":"480p",
"vcodec":"vp9",
"asr":null,
"filesize":18862435,
"fps":24,
"tbr":796.032,
"width":854,
"acodec":"none",
"format":"244 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"135",
"player_url":null,
"ext":"mp4",
"height":480,
"format_note":"480p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":19207551,
"fps":24,
"tbr":1237.434,
"width":854,
"acodec":"none",
"format":"135 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"247",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p",
"vcodec":"vp9",
"asr":null,
"filesize":36550937,
"fps":24,
"tbr":1585.561,
"width":1280,
"acodec":"none",
"format":"247 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"136",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":34995244,
"fps":24,
"tbr":2362.234,
"width":1280,
"acodec":"none",
"format":"136 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"248",
"player_url":null,
"ext":"webm",
"height":1080,
"format_note":"1080p",
"vcodec":"vp9",
"asr":null,
"filesize":63659748,
"fps":24,
"tbr":2747.461,
"width":1920,
"acodec":"none",
"format":"248 - 1920x1080 (1080p)",
"protocol":"https"
},
{
"format_id":"137",
"player_url":null,
"ext":"mp4",
"height":1080,
"format_note":"1080p",
"vcodec":"avc1.640028",
"asr":null,
"filesize":62770019,
"fps":24,
"tbr":4155.019,
"width":1920,
"acodec":"none",
"format":"137 - 1920x1080 (1080p)",
"protocol":"https"
},
{
"format_id":"18",
"player_url":null,
"ext":"mp4",
"width":640,
"height":360,
"acodec":"mp4a.40.2",
"abr":96,
"vcodec":"avc1.42001E",
"asr":44100,
"filesize":21611729,
"format_note":"360p",
"fps":24,
"tbr":431.488,
"format":"18 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"22",
"player_url":null,
"ext":"mp4",
"width":1280,
"height":720,
"acodec":"mp4a.40.2",
"abr":192,
"vcodec":"avc1.64001F",
"asr":44100,
"filesize":null,
"format_note":"720p",
"fps":24,
"tbr":825.41,
"format":"22 - 1280x720 (720p)",
"protocol":"https"
}
],
"is_live":null,
"start_time":null,
"end_time":null,
"series":null,
"season_number":null,
"episode_number":null,
"track":null,
"artist":null,
"album":null,
"release_date":null,
"release_year":null,
"extractor":"youtube",
"extractor_key":"Youtube",
"thumbnail":"https://example.com/maxresdefault.webp",
"requested_subtitles":null,
"format":"137 - 1920x1080 (1080p)+251 - audio only (tiny)",
"format_id":"137+251",
"width":1920,
"height":1080,
"resolution":null,
"fps":24,
"vcodec":"avc1.640028",
"vbr":null,
"stretched_ratio":null,
"acodec":"opus",
"abr":160,
"ext":"mp4"
}

342
app/sync/testdata/metadata_60fps.json vendored Normal file
View File

@ -0,0 +1,342 @@
{
"id":"60fps",
"upload_date":"20191111",
"license":null,
"creator":null,
"title":"60fps",
"alt_title":null,
"description":"60fps",
"categories":[],
"tags":[],
"subtitles":{},
"automatic_captions":{},
"duration":289.0,
"age_limit":0,
"annotations":null,
"chapters":null,
"formats":[
{
"format_id":"249",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":50,
"asr":48000,
"filesize":1870819,
"fps":null,
"height":null,
"tbr":58.007,
"width":null,
"vcodec":"none",
"format":"249 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"250",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":70,
"asr":48000,
"filesize":2449870,
"fps":null,
"height":null,
"tbr":75.669,
"width":null,
"vcodec":"none",
"format":"250 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"140",
"player_url":null,
"ext":"m4a",
"format_note":"tiny",
"acodec":"mp4a.40.2",
"abr":128,
"container":"m4a_dash",
"asr":44100,
"filesize":4663408,
"fps":null,
"height":null,
"tbr":130.556,
"width":null,
"vcodec":"none",
"format":"140 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"251",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":160,
"asr":48000,
"filesize":4753701,
"fps":null,
"height":null,
"tbr":146.615,
"width":null,
"vcodec":"none",
"format":"251 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"278",
"player_url":null,
"ext":"webm",
"height":144,
"format_note":"144p",
"container":"webm",
"vcodec":"vp9",
"asr":null,
"filesize":2977163,
"fps":30,
"tbr":88.365,
"width":256,
"acodec":"none",
"format":"278 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"160",
"player_url":null,
"ext":"mp4",
"height":144,
"format_note":"144p",
"vcodec":"avc1.4d400c",
"asr":null,
"filesize":2535617,
"fps":30,
"tbr":111.075,
"width":256,
"acodec":"none",
"format":"160 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"242",
"player_url":null,
"ext":"webm",
"height":240,
"format_note":"240p",
"vcodec":"vp9",
"asr":null,
"filesize":5737364,
"fps":30,
"tbr":192.191,
"width":426,
"acodec":"none",
"format":"242 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"133",
"player_url":null,
"ext":"mp4",
"height":240,
"format_note":"240p",
"vcodec":"avc1.4d4015",
"asr":null,
"filesize":5021208,
"fps":30,
"tbr":245.185,
"width":426,
"acodec":"none",
"format":"133 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"243",
"player_url":null,
"ext":"webm",
"height":360,
"format_note":"360p",
"vcodec":"vp9",
"asr":null,
"filesize":11239827,
"fps":30,
"tbr":407.893,
"width":640,
"acodec":"none",
"format":"243 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"134",
"player_url":null,
"ext":"mp4",
"height":360,
"format_note":"360p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":8874509,
"fps":30,
"tbr":497.961,
"width":640,
"acodec":"none",
"format":"134 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"135",
"player_url":null,
"ext":"mp4",
"height":480,
"format_note":"480p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":15442192,
"fps":30,
"tbr":745.342,
"width":854,
"acodec":"none",
"format":"135 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"244",
"player_url":null,
"ext":"webm",
"height":480,
"format_note":"480p",
"vcodec":"vp9",
"asr":null,
"filesize":18572091,
"fps":30,
"tbr":754.357,
"width":854,
"acodec":"none",
"format":"244 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"247",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p",
"vcodec":"vp9",
"asr":null,
"filesize":33280726,
"fps":30,
"tbr":1484.764,
"width":1280,
"acodec":"none",
"format":"247 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"136",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":37701417,
"fps":30,
"tbr":2104.312,
"width":1280,
"acodec":"none",
"format":"136 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"302",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p60",
"vcodec":"vp9",
"fps":60,
"asr":null,
"filesize":50207586,
"tbr":2400.348,
"width":1280,
"acodec":"none",
"format":"302 - 1280x720 (720p60)",
"protocol":"https"
},
{
"format_id":"298",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p60",
"vcodec":"avc1.4d4020",
"fps":60,
"asr":null,
"filesize":65788990,
"tbr":3470.649,
"width":1280,
"acodec":"none",
"format":"298 - 1280x720 (720p60)",
"protocol":"https"
},
{
"format_id":"18",
"player_url":null,
"ext":"mp4",
"width":640,
"height":360,
"acodec":"mp4a.40.2",
"abr":96,
"vcodec":"avc1.42001E",
"asr":44100,
"filesize":20192032,
"format_note":"360p",
"fps":30,
"tbr":560.848,
"format":"18 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"22",
"player_url":null,
"ext":"mp4",
"width":1280,
"height":720,
"acodec":"mp4a.40.2",
"abr":192,
"vcodec":"avc1.64001F",
"asr":44100,
"filesize":null,
"format_note":"720p",
"fps":30,
"tbr":1176.187,
"format":"22 - 1280x720 (720p)",
"protocol":"https"
}
],
"is_live":null,
"start_time":null,
"end_time":null,
"series":null,
"season_number":null,
"episode_number":null,
"track":null,
"artist":null,
"album":null,
"release_date":null,
"release_year":null,
"extractor":"youtube",
"extractor_key":"Youtube",
"thumbnail":"https://example.com/maxresdefault.webp",
"requested_subtitles":null,
"format":"298 - 1280x720 (720p60)+251 - audio only (tiny)",
"format_id":"298+251",
"width":1280,
"height":720,
"resolution":null,
"fps":60,
"vcodec":"avc1.4d4020",
"vbr":null,
"stretched_ratio":null,
"acodec":"opus",
"abr":160,
"ext":"mp4"
}

View File

@ -0,0 +1,551 @@
{
"id":"60fpshdr",
"upload_date":"20200529",
"license":null,
"creator":null,
"title":"60fps with HDR",
"alt_title":null,
"description":"60fps with HDR",
"categories":[],
"tags":[],
"subtitles":{},
"automatic_captions":{},
"duration":1225.0,
"age_limit":0,
"annotations":null,
"chapters":null,
"formats":[
{
"format_id":"249",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":50,
"asr":48000,
"filesize":8512058,
"fps":null,
"height":null,
"tbr":69.211,
"width":null,
"vcodec":"none",
"format":"249 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"250",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":70,
"asr":48000,
"filesize":11102913,
"fps":null,
"height":null,
"tbr":91.251,
"width":null,
"vcodec":"none",
"format":"250 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"140",
"player_url":null,
"ext":"m4a",
"format_note":"tiny",
"acodec":"mp4a.40.2",
"abr":128,
"container":"m4a_dash",
"asr":44100,
"filesize":19821739,
"fps":null,
"height":null,
"tbr":131.659,
"width":null,
"vcodec":"none",
"format":"140 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"251",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":160,
"asr":48000,
"filesize":21470525,
"fps":null,
"height":null,
"tbr":179.929,
"width":null,
"vcodec":"none",
"format":"251 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"160",
"player_url":null,
"ext":"mp4",
"height":144,
"format_note":"144p",
"vcodec":"avc1.4d400c",
"asr":null,
"filesize":7980487,
"fps":30,
"tbr":111.635,
"width":256,
"acodec":"none",
"format":"160 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"278",
"player_url":null,
"ext":"webm",
"height":144,
"format_note":"144p",
"container":"webm",
"vcodec":"vp9",
"asr":null,
"filesize":12325312,
"fps":30,
"tbr":172.269,
"width":256,
"acodec":"none",
"format":"278 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"330",
"player_url":null,
"asr":null,
"filesize":30914955,
"format_note":"144p60 HDR",
"fps":60,
"height":144,
"tbr":248.489,
"width":256,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"330 - 256x144 (144p60 HDR)",
"protocol":"https"
},
{
"format_id":"133",
"player_url":null,
"ext":"mp4",
"height":240,
"format_note":"240p",
"vcodec":"avc1.4d4015",
"asr":null,
"filesize":17341221,
"fps":30,
"tbr":249.328,
"width":426,
"acodec":"none",
"format":"133 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"242",
"player_url":null,
"ext":"webm",
"height":240,
"format_note":"240p",
"vcodec":"vp9",
"asr":null,
"filesize":21200666,
"fps":30,
"tbr":324.704,
"width":426,
"acodec":"none",
"format":"242 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"331",
"player_url":null,
"asr":null,
"filesize":66206984,
"format_note":"240p60 HDR",
"fps":60,
"height":240,
"tbr":505.312,
"width":426,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"331 - 426x240 (240p60 HDR)",
"protocol":"https"
},
{
"format_id":"243",
"player_url":null,
"ext":"webm",
"height":360,
"format_note":"360p",
"vcodec":"vp9",
"asr":null,
"filesize":45145322,
"fps":30,
"tbr":625.446,
"width":640,
"acodec":"none",
"format":"243 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"134",
"player_url":null,
"ext":"mp4",
"height":360,
"format_note":"360p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":36679230,
"fps":30,
"tbr":634.64,
"width":640,
"acodec":"none",
"format":"134 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"244",
"player_url":null,
"ext":"webm",
"height":480,
"format_note":"480p",
"vcodec":"vp9",
"asr":null,
"filesize":80021765,
"fps":30,
"tbr":914.834,
"width":854,
"acodec":"none",
"format":"244 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"332",
"player_url":null,
"asr":null,
"filesize":144756945,
"format_note":"360p60 HDR",
"fps":60,
"height":360,
"tbr":1074.178,
"width":640,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"332 - 640x360 (360p60 HDR)",
"protocol":"https"
},
{
"format_id":"135",
"player_url":null,
"ext":"mp4",
"height":480,
"format_note":"480p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":61634125,
"fps":30,
"tbr":1160.027,
"width":854,
"acodec":"none",
"format":"135 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"247",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p",
"vcodec":"vp9",
"asr":null,
"filesize":156141801,
"fps":30,
"tbr":1773.891,
"width":1280,
"acodec":"none",
"format":"247 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"333",
"player_url":null,
"asr":null,
"filesize":281910480,
"format_note":"480p60 HDR",
"fps":60,
"height":480,
"tbr":2002.329,
"width":854,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"333 - 854x480 (480p60 HDR)",
"protocol":"https"
},
{
"format_id":"136",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":99428484,
"fps":30,
"tbr":2315.733,
"width":1280,
"acodec":"none",
"format":"136 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"302",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p60",
"vcodec":"vp9",
"fps":60,
"asr":null,
"filesize":234142087,
"tbr":2741.606,
"width":1280,
"acodec":"none",
"format":"302 - 1280x720 (720p60)",
"protocol":"https"
},
{
"format_id":"298",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p60",
"vcodec":"avc1.4d4020",
"fps":60,
"asr":null,
"filesize":293152085,
"tbr":4075.248,
"width":1280,
"acodec":"none",
"format":"298 - 1280x720 (720p60)",
"protocol":"https"
},
{
"format_id":"334",
"player_url":null,
"asr":null,
"filesize":664805232,
"format_note":"720p60 HDR",
"fps":60,
"height":720,
"tbr":4550.044,
"width":1280,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"334 - 1280x720 (720p60 HDR)",
"protocol":"https"
},
{
"format_id":"303",
"player_url":null,
"ext":"webm",
"height":1080,
"format_note":"1080p60",
"vcodec":"vp9",
"fps":60,
"asr":null,
"filesize":427360829,
"tbr":4604.536,
"width":1920,
"acodec":"none",
"format":"303 - 1920x1080 (1080p60)",
"protocol":"https"
},
{
"format_id":"299",
"player_url":null,
"ext":"mp4",
"height":1080,
"format_note":"1080p60",
"vcodec":"avc1.64002a",
"fps":60,
"asr":null,
"filesize":526570848,
"tbr":6840.241,
"width":1920,
"acodec":"none",
"format":"299 - 1920x1080 (1080p60)",
"protocol":"https"
},
{
"format_id":"335",
"url":"https://r5---sn-ntqe6nee.googlevideo.com/videoplayback?expire=1607507475&ei=s0nQX4HYK_fL3LUPmeGewAc&ip=2404%3Ae80%3A4b4%3A48%3Afdc4%3A9086%3Af1e0%3A9dba&id=o-AK9yHRTiE6MhIQOZwbN_FFFVrcjNjuzNOFHJxuby6t_7&itag=335&aitags=133%2C134%2C135%2C136%2C160%2C242%2C243%2C244%2C247%2C272%2C278%2C298%2C299%2C302%2C303%2C308%2C315%2C330%2C331%2C332%2C333%2C334%2C335%2C336%2C337&source=youtube&requiressl=yes&mh=lV&mm=31%2C26&mn=sn-ntqe6nee%2Csn-npoe7ned&ms=au%2Conr&mv=m&mvi=5&pl=32&initcwndbps=1763750&vprv=1&mime=video%2Fwebm&ns=LrF8qBcGnL-4AEw1lplberwF&gir=yes&clen=1026563583&dur=1224.666&lmt=1597607257610309&mt=1607485470&fvip=5&keepalive=yes&beids=9466587&c=WEB&txp=5431232&n=aX7vTt4fLxHgqpUTJ&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRQIhAK5Mx4xsl9cuqeoT6GPYvR6yjqmPixW_aJXlvBTvTG2IAiAaLuFQWsBJY6qD9va96wtyFMz4Q0C7RHW6jjpn1rUlsA%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRAIgRTWYsm_a49j3OlWI05B9d-3rDTjdk9v-v31Ef0gQqZkCIHXgqek9uOUZTwRAvMWXbGxI8OcIJfZlLDvXriw2qhE2&ratebypass=yes",
"player_url":null,
"asr":null,
"filesize":1026563583,
"format_note":"1080p60 HDR",
"fps":60,
"height":1080,
"tbr":7092.87,
"width":1920,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"335 - 1920x1080 (1080p60 HDR)",
"protocol":"https"
},
{
"format_id":"308",
"player_url":null,
"ext":"webm",
"height":1440,
"format_note":"1440p60",
"vcodec":"vp9",
"fps":60,
"asr":null,
"filesize":1337282162,
"tbr":13646.585,
"width":2560,
"acodec":"none",
"format":"308 - 2560x1440 (1440p60)",
"protocol":"https"
},
{
"format_id":"336",
"player_url":null,
"asr":null,
"filesize":2459997480,
"format_note":"1440p60 HDR",
"fps":60,
"height":1440,
"tbr":16696.968,
"width":2560,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"336 - 2560x1440 (1440p60 HDR)",
"protocol":"https"
},
{
"format_id":"272",
"player_url":null,
"ext":"webm",
"height":4320,
"format_note":"4320p60",
"vcodec":"vp9",
"asr":null,
"filesize":3256069660,
"fps":60,
"tbr":27347.091,
"width":7680,
"acodec":"none",
"format":"272 - 7680x4320 (4320p60)",
"protocol":"https"
},
{
"format_id":"315",
"player_url":null,
"ext":"webm",
"height":2160,
"format_note":"2160p60",
"vcodec":"vp9",
"fps":60,
"asr":null,
"filesize":3608369795,
"tbr":27405.936,
"width":3840,
"acodec":"none",
"format":"315 - 3840x2160 (2160p60)",
"protocol":"https"
},
{
"format_id":"337",
"player_url":null,
"asr":null,
"filesize":4378262991,
"format_note":"2160p60 HDR",
"fps":60,
"height":2160,
"tbr":30090.336,
"width":3840,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"337 - 3840x2160 (2160p60 HDR)",
"protocol":"https"
},
{
"format_id":"18",
"player_url":null,
"ext":"mp4",
"width":640,
"height":360,
"acodec":"mp4a.40.2",
"abr":96,
"vcodec":"avc1.42001E",
"asr":44100,
"filesize":82807429,
"format_note":"360p",
"fps":30,
"tbr":540.93,
"format":"18 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"22",
"player_url":null,
"ext":"mp4",
"width":1280,
"height":720,
"acodec":"mp4a.40.2",
"abr":192,
"vcodec":"avc1.64001F",
"asr":44100,
"filesize":null,
"format_note":"720p",
"fps":30,
"tbr":778.432,
"format":"22 - 1280x720 (720p)",
"protocol":"https"
}
],
"is_live":null,
"start_time":null,
"end_time":null,
"series":null,
"season_number":null,
"episode_number":null,
"track":null,
"artist":null,
"album":null,
"release_date":null,
"release_year":null,
"extractor":"youtube",
"extractor_key":"Youtube",
"thumbnail":"https://example.com/maxresdefault.webp",
"requested_subtitles":null,
"format":"337 - 3840x2160 (2160p60 HDR)+251 - audio only (tiny)",
"format_id":"337+251",
"width":3840,
"height":2160,
"resolution":null,
"fps":60,
"vcodec":"vp9.2",
"vbr":null,
"stretched_ratio":null,
"acodec":"opus",
"abr":160,
"ext":"webm"
}

502
app/sync/testdata/metadata_hdr.json vendored Normal file
View File

@ -0,0 +1,502 @@
{
"id":"hdr",
"upload_date":"20161109",
"license":null,
"creator":null,
"title":"hdr",
"alt_title":null,
"description":"hdr",
"categories":[],
"tags":[],
"subtitles":{},
"automatic_captions":{},
"duration":118.0,
"age_limit":0,
"annotations":null,
"chapters":null,
"formats":[
{
"format_id":"249",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":50,
"asr":48000,
"filesize":846425,
"fps":null,
"height":null,
"tbr":60.208,
"width":null,
"vcodec":"none",
"format":"249 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"250",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":70,
"asr":48000,
"filesize":1126262,
"fps":null,
"height":null,
"tbr":79.173,
"width":null,
"vcodec":"none",
"format":"250 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"140",
"player_url":null,
"ext":"m4a",
"format_note":"tiny",
"acodec":"mp4a.40.2",
"abr":128,
"container":"m4a_dash",
"asr":44100,
"filesize":1902693,
"fps":null,
"height":null,
"tbr":130.432,
"width":null,
"vcodec":"none",
"format":"140 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"251",
"player_url":null,
"ext":"webm",
"format_note":"tiny",
"acodec":"opus",
"abr":160,
"asr":48000,
"filesize":2141091,
"fps":null,
"height":null,
"tbr":150.305,
"width":null,
"vcodec":"none",
"format":"251 - audio only (tiny)",
"protocol":"https"
},
{
"format_id":"160",
"player_url":null,
"ext":"mp4",
"height":144,
"format_note":"144p",
"vcodec":"avc1.4d400c",
"asr":null,
"filesize":458348,
"fps":24,
"tbr":43.288,
"width":256,
"acodec":"none",
"format":"160 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"133",
"player_url":null,
"ext":"mp4",
"height":240,
"format_note":"240p",
"vcodec":"avc1.4d4015",
"asr":null,
"filesize":974592,
"fps":24,
"tbr":92.086,
"width":426,
"acodec":"none",
"format":"133 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"278",
"player_url":null,
"ext":"webm",
"height":144,
"format_note":"144p",
"container":"webm",
"vcodec":"vp9",
"asr":null,
"filesize":1273663,
"fps":24,
"tbr":95.995,
"width":256,
"acodec":"none",
"format":"278 - 256x144 (144p)",
"protocol":"https"
},
{
"format_id":"330",
"player_url":null,
"asr":null,
"filesize":1620022,
"format_note":"144p HDR",
"fps":24,
"height":144,
"tbr":130.515,
"width":256,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"330 - 256x144 (144p HDR)",
"protocol":"https"
},
{
"format_id":"242",
"player_url":null,
"ext":"webm",
"height":240,
"format_note":"240p",
"vcodec":"vp9",
"asr":null,
"filesize":1565384,
"fps":24,
"tbr":143.325,
"width":426,
"acodec":"none",
"format":"242 - 426x240 (240p)",
"protocol":"https"
},
{
"format_id":"331",
"player_url":null,
"asr":null,
"filesize":2910740,
"format_note":"240p HDR",
"fps":24,
"height":240,
"tbr":221.449,
"width":426,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"331 - 426x240 (240p HDR)",
"protocol":"https"
},
{
"format_id":"134",
"player_url":null,
"ext":"mp4",
"height":360,
"format_note":"360p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":2845501,
"fps":24,
"tbr":265.501,
"width":640,
"acodec":"none",
"format":"134 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"243",
"player_url":null,
"ext":"webm",
"height":360,
"format_note":"360p",
"vcodec":"vp9",
"asr":null,
"filesize":3361873,
"fps":24,
"tbr":303.494,
"width":640,
"acodec":"none",
"format":"243 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"332",
"player_url":null,
"asr":null,
"filesize":6418173,
"format_note":"360p HDR",
"fps":24,
"height":360,
"tbr":478.757,
"width":640,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"332 - 640x360 (360p HDR)",
"protocol":"https"
},
{
"format_id":"244",
"player_url":null,
"ext":"webm",
"height":480,
"format_note":"480p",
"vcodec":"vp9",
"asr":null,
"filesize":6282780,
"fps":24,
"tbr":545.429,
"width":854,
"acodec":"none",
"format":"244 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"135",
"player_url":null,
"ext":"mp4",
"height":480,
"format_note":"480p",
"vcodec":"avc1.4d401e",
"asr":null,
"filesize":6404636,
"fps":24,
"tbr":619.85,
"width":854,
"acodec":"none",
"format":"135 - 854x480 (480p)",
"protocol":"https"
},
{
"format_id":"333",
"player_url":null,
"asr":null,
"filesize":12520807,
"format_note":"480p HDR",
"fps":24,
"height":480,
"tbr":902.636,
"width":854,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"333 - 854x480 (480p HDR)",
"protocol":"https"
},
{
"format_id":"136",
"player_url":null,
"ext":"mp4",
"height":720,
"format_note":"720p",
"vcodec":"avc1.4d401f",
"asr":null,
"filesize":13646566,
"fps":24,
"tbr":1318.273,
"width":1280,
"acodec":"none",
"format":"136 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"247",
"player_url":null,
"ext":"webm",
"height":720,
"format_note":"720p",
"vcodec":"vp9",
"asr":null,
"filesize":15047273,
"fps":24,
"tbr":1335.23,
"width":1280,
"acodec":"none",
"format":"247 - 1280x720 (720p)",
"protocol":"https"
},
{
"format_id":"334",
"player_url":null,
"asr":null,
"filesize":28956363,
"format_note":"720p HDR",
"fps":24,
"height":720,
"tbr":2050.091,
"width":1280,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"334 - 1280x720 (720p HDR)",
"protocol":"https"
},
{
"format_id":"248",
"player_url":null,
"ext":"webm",
"height":1080,
"format_note":"1080p",
"vcodec":"vp9",
"asr":null,
"filesize":29892111,
"fps":24,
"tbr":2521.353,
"width":1920,
"acodec":"none",
"format":"248 - 1920x1080 (1080p)",
"protocol":"https"
},
{
"format_id":"137",
"player_url":null,
"ext":"mp4",
"height":1080,
"format_note":"1080p",
"vcodec":"avc1.640028",
"asr":null,
"filesize":26734027,
"fps":24,
"tbr":2548.593,
"width":1920,
"acodec":"none",
"format":"137 - 1920x1080 (1080p)",
"protocol":"https"
},
{
"format_id":"335",
"player_url":null,
"asr":null,
"filesize":51033319,
"format_note":"1080p HDR",
"fps":24,
"height":1080,
"tbr":3550.019,
"width":1920,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"335 - 1920x1080 (1080p HDR)",
"protocol":"https"
},
{
"format_id":"271",
"player_url":null,
"ext":"webm",
"height":1440,
"format_note":"1440p",
"vcodec":"vp9",
"asr":null,
"filesize":80944570,
"fps":24,
"tbr":6965.068,
"width":2560,
"acodec":"none",
"format":"271 - 2560x1440 (1440p)",
"protocol":"https"
},
{
"format_id":"336",
"player_url":null,
"asr":null,
"filesize":143288990,
"format_note":"1440p HDR",
"fps":24,
"height":1440,
"tbr":10066.781,
"width":2560,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"336 - 2560x1440 (1440p HDR)",
"protocol":"https"
},
{
"format_id":"313",
"player_url":null,
"ext":"webm",
"height":2160,
"format_note":"2160p",
"vcodec":"vp9",
"asr":null,
"filesize":238816879,
"fps":24,
"tbr":17450.488,
"width":3840,
"acodec":"none",
"format":"313 - 3840x2160 (2160p)",
"protocol":"https"
},
{
"format_id":"337",
"player_url":null,
"asr":null,
"filesize":329492052,
"format_note":"2160p HDR",
"fps":24,
"height":2160,
"tbr":23198.764,
"width":3840,
"ext":"webm",
"vcodec":"vp9.2",
"acodec":"none",
"format":"337 - 3840x2160 (2160p HDR)",
"protocol":"https"
},
{
"format_id":"18",
"player_url":null,
"ext":"mp4",
"width":640,
"height":360,
"acodec":"mp4a.40.2",
"abr":96,
"vcodec":"avc1.42001E",
"asr":44100,
"filesize":6587979,
"format_note":"360p",
"fps":24,
"tbr":448.703,
"format":"18 - 640x360 (360p)",
"protocol":"https"
},
{
"format_id":"22",
"player_url":null,
"ext":"mp4",
"width":1280,
"height":720,
"acodec":"mp4a.40.2",
"abr":192,
"vcodec":"avc1.64001F",
"asr":44100,
"filesize":null,
"format_note":"720p",
"fps":24,
"tbr":1058.627,
"format":"22 - 1280x720 (720p)",
"protocol":"https"
}
],
"is_live":null,
"start_time":null,
"end_time":null,
"series":null,
"season_number":null,
"episode_number":null,
"track":null,
"artist":null,
"album":null,
"release_date":null,
"release_year":null,
"extractor":"youtube",
"extractor_key":"Youtube",
"thumbnail":"https://example.com/vi_webp/WW2DKBGCvEs/maxresdefault.webp",
"requested_subtitles":null,
"format":"337 - 3840x2160 (2160p HDR)+251 - audio only (tiny)",
"format_id":"337+251",
"width":3840,
"height":2160,
"resolution":null,
"fps":24,
"vcodec":"vp9.2",
"vbr":null,
"stretched_ratio":null,
"acodec":"opus",
"abr":160,
"ext":"webm"
}

File diff suppressed because it is too large Load Diff

View File

@ -154,9 +154,9 @@ def parse_media_format(format_dict):
format_full = format_dict.get('format_note', '').strip().upper()
format_str = format_full[:-2] if format_full.endswith('60') else format_full
format_str = format_str.strip()
format_str = format_full[:-3] if format_full.endswith('HDR') else format_full
format_str = format_str[:-3] if format_str.endswith('HDR') else format_str
format_str = format_str.strip()
format_str = format_full[:-2] if format_full.endswith('60') else format_full
format_str = format_str[:-2] if format_str.endswith('60') else format_str
format_str = format_str.strip()
return {
'id': format_dict.get('format_id', ''),