aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/abc.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-01-23 23:24:24 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-01-24 01:07:14 +0530
commitf40ee5e9a0014b308cc83d8d3a0e24a123239eb4 (patch)
treea9ce83f69e44d1a63344b115e380f01286012ea1 /yt_dlp/extractor/abc.py
parent1f13021eca0ecc5a6bd34ffd5bf69aa5a8cb8a5a (diff)
downloadhypervideo-pre-f40ee5e9a0014b308cc83d8d3a0e24a123239eb4.tar.lz
hypervideo-pre-f40ee5e9a0014b308cc83d8d3a0e24a123239eb4.tar.xz
hypervideo-pre-f40ee5e9a0014b308cc83d8d3a0e24a123239eb4.zip
[extractor] Add convinience function `_yes_playlist`
Diffstat (limited to 'yt_dlp/extractor/abc.py')
-rw-r--r--yt_dlp/extractor/abc.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py
index 354453a27..0dde4a9a5 100644
--- a/yt_dlp/extractor/abc.py
+++ b/yt_dlp/extractor/abc.py
@@ -300,11 +300,10 @@ class ABCIViewShowSeriesIE(InfoExtractor):
unescapeHTML(webpage_data).encode('utf-8').decode('unicode_escape'), show_id)
video_data = video_data['route']['pageData']['_embedded']
- if self.get_param('noplaylist') and 'highlightVideo' in video_data:
- self.to_screen('Downloading just the highlight video because of --no-playlist')
- return self.url_result(video_data['highlightVideo']['shareUrl'], ie=ABCIViewIE.ie_key())
+ highlight = try_get(video_data, lambda x: ['highlightVideo']['shareUrl'])
+ if not self._yes_playlist(show_id, bool(highlight), video_label='highlight video'):
+ return self.url_result(highlight, ie=ABCIViewIE.ie_key())
- self.to_screen(f'Downloading playlist {show_id} - add --no-playlist to just download the highlight video')
series = video_data['selectedSeries']
return {
'_type': 'playlist',