[external:ffmpeg] In test harness, limit to 10k download size
authorJohn Hawkinson <jhawk@mit.edu>
Sun, 5 Mar 2017 03:19:44 +0000 (22:19 -0500)
committerSergey M <dstftw@gmail.com>
Sun, 5 Mar 2017 03:19:44 +0000 (11:19 +0800)
Otherwise, if you screw up a playlist test by including a playlist
dictionary key, you'll be there for eons while it downloads all the
files before erroring out.

youtube_dl/downloader/external.py

index bdd3545a2f17a731f2b9326be9de68034b4fb86e..127a92d20054633ca23b6a7771009812041e603c 100644 (file)
@@ -270,6 +270,10 @@ class FFmpegFD(ExternalFD):
                 args += ['-rtmp_live', 'live']
 
         args += ['-i', url, '-c', 'copy']
+
+        if self.params.get('test', False):
+            args += ['-fs', compat_str(self._TEST_FILE_SIZE)] # -fs limit_size (output), expressed in bytes
+
         if protocol in ('m3u8', 'm3u8_native'):
             if self.params.get('hls_use_mpegts', False) or tmpfilename == '-':
                 args += ['-f', 'mpegts']