[Core] hls manifests, dynamic mpd

This commit is contained in:
Unknown 2020-09-16 13:00:41 +02:00
parent 08676fb591
commit 78895bd3a1
5 changed files with 44 additions and 4 deletions

View File

@ -12,7 +12,20 @@ youtube-dlc is a fork of youtube-dl with the intention of getting features teste
- [INSTALLATION](#installation)
- [DESCRIPTION](#description)
- [OPTIONS](#options)
- [COPYRIGHT](#copyright)
- [Network Options:](#network-options)
- [Geo Restriction:](#geo-restriction)
- [Video Selection:](#video-selection)
- [Download Options:](#download-options)
- [Filesystem Options:](#filesystem-options)
- [Thumbnail images:](#thumbnail-images)
- [Verbosity / Simulation Options:](#verbosity--simulation-options)
- [Workarounds:](#workarounds)
- [Video Format Options:](#video-format-options)
- [Subtitle Options:](#subtitle-options)
- [Authentication Options:](#authentication-options)
- [Adobe Pass Options:](#adobe-pass-options)
- [Post-processing Options:](#post-processing-options)
- [Extractor Options:](#extractor-options)
# INSTALLATION
@ -355,6 +368,8 @@ Then simply type this
videos
--youtube-skip-dash-manifest Do not download the DASH manifests and
related data on YouTube videos
--youtube-skip-hls-manifest Do not download the HLS manifests and
related data on YouTube videos
--merge-output-format FORMAT If a merge is required (e.g.
bestvideo+bestaudio), output to given
container format. One of mkv, mp4, ogg,
@ -453,3 +468,5 @@ Then simply type this
--convert-subs FORMAT Convert the subtitles to other format
(currently supported: srt|ass|vtt|lrc)
## Extractor Options:
--ignore-dynamic-mpd Do not process dynamic DASH manifests

View File

@ -414,7 +414,9 @@ def _real_main(argv=None):
'prefer_ffmpeg': opts.prefer_ffmpeg,
'include_ads': opts.include_ads,
'default_search': opts.default_search,
'dynamic_mpd': opts.dynamic_mpd,
'youtube_include_dash_manifest': opts.youtube_include_dash_manifest,
'youtube_include_hls_manifest': opts.youtube_include_hls_manifest,
'encoding': opts.encoding,
'extract_flat': opts.extract_flat,
'mark_watched': opts.mark_watched,

View File

@ -2071,8 +2071,9 @@ class InfoExtractor(object):
http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip
2. https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP
"""
if mpd_doc.get('type') == 'dynamic':
return []
if not self._downloader.params.get('dynamic_mpd'):
if mpd_doc.get('type') == 'dynamic':
return []
namespace = self._search_regex(r'(?i)^{([^}]+)?}MPD$', mpd_doc.tag, 'namespace', default=None)

View File

@ -2244,7 +2244,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
a_format['player_url'] = player_url
# Accept-Encoding header causes failures in live streams on Youtube and Youtube Gaming
a_format.setdefault('http_headers', {})['Youtubedl-no-compression'] = 'True'
formats.append(a_format)
if self._downloader.params.get('youtube_include_hls_manifest', True):
formats.append(a_format)
else:
error_message = extract_unavailable_message()
if not error_message:

View File

@ -414,6 +414,14 @@ def parseOpts(overrideArguments=None):
'--youtube-skip-dash-manifest',
action='store_false', dest='youtube_include_dash_manifest',
help='Do not download the DASH manifests and related data on YouTube videos')
video_format.add_option(
'--youtube-include-hls-manifest',
action='store_true', dest='youtube_include_hls_manifest', default=True,
help=optparse.SUPPRESS_HELP)
video_format.add_option(
'--youtube-skip-hls-manifest',
action='store_false', dest='youtube_include_hls_manifest',
help='Do not download the HLS manifests and related data on YouTube videos')
video_format.add_option(
'--merge-output-format',
action='store', dest='merge_output_format', metavar='FORMAT', default=None,
@ -863,6 +871,16 @@ def parseOpts(overrideArguments=None):
metavar='FORMAT', dest='convertsubtitles', default=None,
help='Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc)')
extractor = optparse.OptionGroup(parser, 'Extractor Options')
extractor.add_option(
'--allow-dynamic-mpd',
action='store_true', dest='dynamic_mpd', default=True,
help=optparse.SUPPRESS_HELP)
extractor.add_option(
'--ignore-dynamic-mpd',
action='store_false', dest='dynamic_mpd',
help='Do not process dynamic DASH manifests')
parser.add_option_group(general)
parser.add_option_group(network)
parser.add_option_group(geo)
@ -877,6 +895,7 @@ def parseOpts(overrideArguments=None):
parser.add_option_group(authentication)
parser.add_option_group(adobe_pass)
parser.add_option_group(postproc)
parser.add_option_group(extractor)
if overrideArguments is not None:
opts, args = parser.parse_args(overrideArguments)