diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-07 11:32:15 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2021-08-07 12:47:54 +0530 |
commit | 57015a4a3f15b23c152ffd2d72ed9ef520664ee5 (patch) | |
tree | ff74f30f6dd758c2ee6ff727fa3c6566f9809066 | |
parent | 9cc1a3130a5e3f14a989e5d3232c1653aa5bdc3b (diff) | |
download | hypervideo-pre-57015a4a3f15b23c152ffd2d72ed9ef520664ee5.tar.lz hypervideo-pre-57015a4a3f15b23c152ffd2d72ed9ef520664ee5.tar.xz hypervideo-pre-57015a4a3f15b23c152ffd2d72ed9ef520664ee5.zip |
[youtube] extractor-arg to show live dash formats
If replay is enabled, these formats can be used to download the last 4 hours
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | yt_dlp/extractor/youtube.py | 6 | ||||
-rw-r--r-- | yt_dlp/options.py | 2 |
3 files changed, 6 insertions, 3 deletions
@@ -1381,6 +1381,7 @@ The following extractors use this feature: * `skip`: `hls` or `dash` (or both) to skip download of the respective manifests * `player_client`: Clients to extract video data from. The main clients are `web`, `android`, `ios`, `mweb`. These also have `_music`, `_embedded`, `_agegate`, and `_creator` variants (Eg: `web_embedded`) (`mweb` has only `_agegate`). By default, `android,web` is used, but the agegate and creator variants are added as required for age-gated videos. Similarly the music variants are added for `music.youtube.com` urls. You can also use `all` to use all the clients * `player_skip`: `configs` - skip any requests for client configs and use defaults + * `include_live_dash`: Include live dash formats (These formats don't download properly) * `comment_sort`: `top` or `new` (default) - choose comment sorting mode (on YouTube's side). * `max_comments`: maximum amount of comments to download (default all). * `max_comment_depth`: maximum depth for nested comments. YouTube supports depths 1 or 2 (default). diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 46fa31a73..d5813e288 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -2628,7 +2628,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor): yield dct skip_manifests = self._configuration_arg('skip') - get_dash = not is_live and 'dash' not in skip_manifests and self.get_param('youtube_include_dash_manifest', True) + get_dash = ( + (not is_live or self._configuration_arg('include_live_dash')) + and 'dash' not in skip_manifests and self.get_param('youtube_include_dash_manifest', True)) get_hls = 'hls' not in skip_manifests and self.get_param('youtube_include_hls_manifest', True) def guess_quality(f): @@ -3458,7 +3460,7 @@ class YoutubeTabIE(YoutubeBaseInfoExtractor): }, { 'url': 'https://www.youtube.com/channel/UCoMdktPbSTixAyNGwb-UYkQ/live', 'info_dict': { - 'id': 'FMtPN8yp5LU', # This will keep changing + 'id': '3yImotZU3tw', # This will keep changing 'ext': 'mp4', 'title': compat_str, 'uploader': 'Sky News', diff --git a/yt_dlp/options.py b/yt_dlp/options.py index b5ddbeaff..e70471282 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -1367,7 +1367,7 @@ def parseOpts(overrideArguments=None): '--no-hls-split-discontinuity', dest='hls_split_discontinuity', action='store_false', help='Do not split HLS playlists to different formats at discontinuities such as ad breaks (default)') - _extractor_arg_parser = lambda key, vals='': (key.strip().lower(), [val.strip() for val in vals.split(',')]) + _extractor_arg_parser = lambda key, vals='': (key.strip().lower().replace('-', '_'), [val.strip() for val in vals.split(',')]) extractor.add_option( '--extractor-args', metavar='KEY:ARGS', dest='extractor_args', default={}, type='str', |