aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/litv.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/litv.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/litv.py')
-rw-r--r--yt_dlp/extractor/litv.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/yt_dlp/extractor/litv.py b/yt_dlp/extractor/litv.py
index 18d237ef9..73822def1 100644
--- a/yt_dlp/extractor/litv.py
+++ b/yt_dlp/extractor/litv.py
@@ -7,6 +7,7 @@ from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
+ traverse_obj,
smuggle_url,
unsmuggle_url,
)
@@ -55,9 +56,6 @@ class LiTVIE(InfoExtractor):
episode_title = program_info['title']
content_id = season_list['contentId']
- if prompt:
- self.to_screen('Downloading playlist %s - add --no-playlist to just download video %s' % (content_id, video_id))
-
all_episodes = [
self.url_result(smuggle_url(
self._URL_TEMPLATE % (program_info['contentType'], episode['contentId']),
@@ -71,12 +69,6 @@ class LiTVIE(InfoExtractor):
video_id = self._match_id(url)
- noplaylist = self.get_param('noplaylist')
- noplaylist_prompt = True
- if 'force_noplaylist' in data:
- noplaylist = data['force_noplaylist']
- noplaylist_prompt = False
-
webpage = self._download_webpage(url, video_id)
program_info = self._parse_json(self._search_regex(
@@ -84,14 +76,9 @@ class LiTVIE(InfoExtractor):
video_id)
season_list = list(program_info.get('seasonList', {}).values())
- if season_list:
- if not noplaylist:
- return self._extract_playlist(
- season_list[0], video_id, program_info,
- prompt=noplaylist_prompt)
-
- if noplaylist_prompt:
- self.to_screen('Downloading just video %s because of --no-playlist' % video_id)
+ playlist_id = traverse_obj(season_list, 0, 'contentId')
+ if self._yes_playlist(playlist_id, video_id, smuggled_data):
+ return self._extract_playlist(season_list[0], video_id, program_info)
# In browsers `getMainUrl` request is always issued. Usually this
# endpoint gives the same result as the data embedded in the webpage.