From cb844616d3fd99493dd4bc463470c968ffa411a3 Mon Sep 17 00:00:00 2001 From: "me@disf.asia" Date: Thu, 22 May 2014 15:31:14 +0700 Subject: [PATCH] Parameter "playlistonly" makes YoutubeDL skip fetching data for each playlist entry --- youtube_dl/YoutubeDL.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 0b270ba49..a0d2975f5 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -114,6 +114,7 @@ class YoutubeDL(object): nooverwrites: Prevent overwriting files. playliststart: Playlist item to start at. playlistend: Playlist item to end at. + playlistonly: Stops after getting the playlist entries matchtitle: Download only matching titles. rejecttitle: Reject downloads for matching titles. logger: Log messages to a logging.Logger instance. @@ -661,11 +662,13 @@ class YoutubeDL(object): self.to_screen('[download] ' + reason) continue - entry_result = self.process_ie_result(entry, + if not self.params.get('playlistonly', False): + entry_result = self.process_ie_result(entry, download=download, extra_info=extra) - playlist_results.append(entry_result) - + playlist_results.append(entry_result) + else: + playlist_results.append(entry) playlistProgress = { 'current': n_entries, @@ -678,10 +681,9 @@ class YoutubeDL(object): for ph in self._metadata_hooks: ph(playlistProgress) - - ie_result['entries'] = playlist_results return ie_result + elif result_type == 'compat_list': def _fixup(r): self.add_extra_info(r,