[youtube] Make DASH manifest download conditional for now
authorPhilipp Hagemeister <phihag@phihag.de>
Wed, 22 Jan 2014 20:56:37 +0000 (21:56 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Wed, 22 Jan 2014 20:56:38 +0000 (21:56 +0100)
DASH download fails on many videos (all with encrypted signatures? not sure yet), for example 07FYdnEawAQ, with a 403.

youtube_dl/__init__.py
youtube_dl/extractor/youtube.py

index 568c5e6d061406cbd9f8834dba1a23a2fdcd1ac4..870145c3638906d2e3c0b9530a5fe57bcda51462 100644 (file)
@@ -244,6 +244,10 @@ def parseOpts(overrideArguments=None):
         '--include-ads', dest='include_ads',
         action='store_true',
         help='Download advertisements as well (experimental)')
+    verbosity.add_option(
+        '--youtube-include-dash-manifest', action='store_true',
+        dest='youtube_include_dash_manifest', default=False,
+        help='Try to download the DASH manifest on YouTube videos (experimental)')
 
     authentication.add_option('-u', '--username',
             dest='username', metavar='USERNAME', help='account username')
@@ -348,7 +352,8 @@ def parseOpts(overrideArguments=None):
             help=optparse.SUPPRESS_HELP)
     verbosity.add_option('--print-traffic',
             dest='debug_printtraffic', action='store_true', default=False,
-            help=optparse.SUPPRESS_HELP)
+            help='Display sent and read HTTP traffic')
+
 
     filesystem.add_option('-t', '--title',
             action='store_true', dest='usetitle', help='use title in file name (default)', default=False)
@@ -729,6 +734,7 @@ def _real_main(argv=None):
         'prefer_ffmpeg': opts.prefer_ffmpeg,
         'include_ads': opts.include_ads,
         'default_search': opts.default_search,
+        'youtube_include_dash_manifest': opts.youtube_include_dash_manifest,
     }
 
     with YoutubeDL(ydl_opts) as ydl:
index 57b8fdff7204b1fbb5dc6d88742704638995b0eb..17576330934470435f1ca1aa6135959f91da13f5 100644 (file)
@@ -276,16 +276,17 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
             u"url": u"http://www.youtube.com/watch?v=a9LDPn-MO4I",
             u"file": u"a9LDPn-MO4I.m4a",
             u"note": u"256k DASH audio (format 141) via DASH manifest",
-            u"params": {
-                u"format": "141"
-            },
             u"info_dict": {
                 u"upload_date": "20121002",
                 u"uploader_id": "8KVIDEO",
                 u"description": "No description available.",
                 u"uploader": "8KVIDEO",
                 u"title": "UHDTV TEST 8K VIDEO.mp4"
-            }
+            },
+            u"params": {
+                u"youtube_include_dash_manifest": True,
+                u"format": "141",
+            },
         },
     ]
 
@@ -1355,7 +1356,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
 
         # Look for the DASH manifest
         dash_manifest_url_lst = video_info.get('dashmpd')
-        if dash_manifest_url_lst and dash_manifest_url_lst[0]:
+        if (dash_manifest_url_lst and dash_manifest_url_lst[0] and
+                self._downloader.params.get('youtube_include_dash_manifest', False)):
             try:
                 dash_doc = self._download_xml(
                     dash_manifest_url_lst[0], video_id,