[downloader/f4m] Do not update fragment list while test
authorSergey M․ <dstftw@gmail.com>
Sat, 30 Jan 2016 13:43:25 +0000 (19:43 +0600)
committerSergey M․ <dstftw@gmail.com>
Sat, 30 Jan 2016 13:43:25 +0000 (19:43 +0600)
youtube_dl/downloader/f4m.py

index 581fa7b71d1432e4274efdc60423baf9531ed8e5..fc9642905f3fffb5f1ec11f959c36fd486b757f2 100644 (file)
@@ -322,7 +322,8 @@ class F4mFD(FragmentFD):
             metadata = None
 
         fragments_list = build_fragments_list(boot_info)
-        if self.params.get('test', False):
+        test = self.params.get('test', False)
+        if test:
             # We only download the first fragment
             fragments_list = fragments_list[:1]
         total_frags = len(fragments_list)
@@ -387,7 +388,7 @@ class F4mFD(FragmentFD):
                 else:
                     raise
 
-            if not fragments_list and live and bootstrap_url:
+            if not fragments_list and not test and live and bootstrap_url:
                 fragments_list = self._update_live_fragments(bootstrap_url, frag_i)
                 total_frags += len(fragments_list)
                 if fragments_list and (fragments_list[0][1] > frag_i + 1):