]> jfr.im git - yt-dlp.git/commitdiff
[Core] hls manifests, dynamic mpd
authorUnknown <redacted>
Wed, 16 Sep 2020 11:00:41 +0000 (13:00 +0200)
committerUnknown <redacted>
Wed, 16 Sep 2020 11:00:41 +0000 (13:00 +0200)
README.md
youtube_dlc/__init__.py
youtube_dlc/extractor/common.py
youtube_dlc/extractor/youtube.py
youtube_dlc/options.py

index 2a51eb66c5ea60e3e380faf83f850d92e9a50d4e..b15653c23985fc106b318ee49e74b72d9602cfa3 100644 (file)
--- a/README.md
+++ b/README.md
 - [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 @@ ## Video Format Options:
                                      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 @@ ## Post-processing Options:
     --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
\ No newline at end of file
index 13b658eff4b2b3e4930e04ba4e99219f6d5e1583..f944cd70f5125b054217a7a0b3f50e6f5949799c 100644 (file)
@@ -414,7 +414,9 @@ def parse_retries(retries):
         '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,
index c1ea5d84603f9e821e789648bac743a7c6d2c9b6..310229d5740cb2a2cf529c656aec298fa137c1f1 100644 (file)
@@ -2071,8 +2071,9 @@ def _parse_mpd_formats(self, mpd_doc, mpd_id=None, mpd_base_url='', formats_dict
             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)
 
index 1c19377213f9e725863d9bbc93bcea0a48d8691e..d781c35b5f6fd88a71ff6be642802bdfad2619a3 100644 (file)
@@ -2244,7 +2244,8 @@ def _extract_filesize(media_url):
                     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:
index ea372dd6d3c200c6d04aa090234652f33f0d590d..e6873c703ffe5260143e44d603453d2dc2296e97 100644 (file)
@@ -414,6 +414,14 @@ def _comma_separated_values_options_callback(option, opt_str, value, parser):
         '--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 _comma_separated_values_options_callback(option, opt_str, value, parser):
         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 _comma_separated_values_options_callback(option, opt_str, value, parser):
     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)