From 3c3d9b78f9402b44f4a28f09c3000617af25190b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 16 Apr 2016 23:57:05 +0600 Subject: [PATCH] [downloader/f4m] Skip fragment downloading in test (Closes #9214) --- youtube_dl/downloader/f4m.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/youtube_dl/downloader/f4m.py b/youtube_dl/downloader/f4m.py index 664d87543..8cb1f6f4e 100644 --- a/youtube_dl/downloader/f4m.py +++ b/youtube_dl/downloader/f4m.py @@ -328,8 +328,11 @@ class F4mFD(FragmentFD): fragments_list = build_fragments_list(boot_info) test = self.params.get('test', False) if test: - # We only download the first fragment - fragments_list = fragments_list[:1] + # We will not download any fragments during test since truncated + # fragment file may introduce bogus parse error in FlvReader thus + # making the whole test to fail erroneously + return True + total_frags = len(fragments_list) # For some akamai manifests we'll need to add a query to the fragment url akamai_pv = xpath_text(doc, _add_ns('pv-2.0'))