diff options
author | u-spec-png <54671367+u-spec-png@users.noreply.github.com> | 2021-10-07 14:32:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 20:02:42 +0530 |
commit | fee3f44f5f58274c637499f077aa0312e650f493 (patch) | |
tree | 546c408e689f1a8a70e5667f9901e958f55aabc2 | |
parent | 705e7c2005dfe67a905e18736c9f6345ee9d386b (diff) | |
download | hypervideo-pre-fee3f44f5f58274c637499f077aa0312e650f493.tar.lz hypervideo-pre-fee3f44f5f58274c637499f077aa0312e650f493.tar.xz hypervideo-pre-fee3f44f5f58274c637499f077aa0312e650f493.zip |
[Streamable] Add codecs (#1189)
Authored by: u-spec-png
-rw-r--r-- | yt_dlp/extractor/streamable.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/yt_dlp/extractor/streamable.py b/yt_dlp/extractor/streamable.py index 34725274e..808129649 100644 --- a/yt_dlp/extractor/streamable.py +++ b/yt_dlp/extractor/streamable.py @@ -8,6 +8,8 @@ from ..utils import ( ExtractorError, float_or_none, int_or_none, + try_get, + parse_codecs, ) @@ -29,7 +31,7 @@ class StreamableIE(InfoExtractor): 'view_count': int, } }, - # older video without bitrate, width/height, etc. info + # older video without bitrate, width/height, codecs, etc. info { 'url': 'https://streamable.com/moo', 'md5': '2cf6923639b87fba3279ad0df3a64e73', @@ -95,7 +97,9 @@ class StreamableIE(InfoExtractor): 'height': int_or_none(info.get('height')), 'filesize': int_or_none(info.get('size')), 'fps': int_or_none(info.get('framerate')), - 'vbr': float_or_none(info.get('bitrate'), 1000) + 'vbr': float_or_none(info.get('bitrate'), 1000), + 'vcodec': parse_codecs(try_get(info, lambda x: x['input_metadata']['video_codec_name'])).get('vcodec'), + 'acodec': parse_codecs(try_get(info, lambda x: x['input_metadata']['audio_codec_name'])).get('acodec'), }) self._sort_formats(formats) |