From 3a31e52d278e20c2cd8297c6b68879bd51d69ea3 Mon Sep 17 00:00:00 2001 From: dirkf Date: Wed, 4 Oct 2023 00:59:11 +0100 Subject: [PATCH] [test] pl_counts --- test/test_download.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_download.py b/test/test_download.py index 71708788f..a01fc7f20 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -123,8 +123,10 @@ def generator(test_case, tname): params['outtmpl'] = tname + '_' + params['outtmpl'] if is_playlist and 'playlist' not in test_case: params.setdefault('extract_flat', 'in_playlist') - if traverse_obj(test_case, 'playlist_count', 'playlist_maxcount', default=-1) < 0: - params.setdefault('playlistend', test_case.get('playlist_mincount')) + # only process enough items for specified tests + pl_counts = traverse_obj(test_case, (None, ('playlist_count', 'playlist_mincount', 'playlist_maxcount'))) + if pl_counts: + params.setdefault('playlistend', max(pl_counts) + 1) params.setdefault('skip_download', True) ydl = YoutubeDL(params, auto_init=False)