From 2e19aac492daec451e6ca119110dca7e23bbc5f1 Mon Sep 17 00:00:00 2001 From: Dorian Westacott Date: Wed, 16 Mar 2022 18:54:20 -0500 Subject: [PATCH] Support multiple pages From https://github.com/yt-dlp/yt-dlp/pull/3026 Authored by: dodrian --- youtube_dl/extractor/paramountplus.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/paramountplus.py b/youtube_dl/extractor/paramountplus.py index 86c07f61f..67a04e5ff 100644 --- a/youtube_dl/extractor/paramountplus.py +++ b/youtube_dl/extractor/paramountplus.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals +import itertools from .common import InfoExtractor from .cbs import CBSBaseIE @@ -130,11 +131,13 @@ class ParamountPlusSeriesIE(InfoExtractor): 'id': 'spongebob-squarepants', } }] - _API_URL = 'https://www.paramountplus.com/shows/{}/xhr/episodes/page/0/size/100000/xs/0/season/0/' def _entries(self, show_name): - show_json = self._download_json(self._API_URL.format(show_name), video_id=show_name) - if show_json.get('success'): + for page in itertools.count(): + show_json = self._download_json( + 'https://www.paramountplus.com/shows/{0}/xhr/episodes/page/{1}/size/50/xs/0/season/0'.format(show_name, page), show_name) + if not show_json.get('success'): + return for episode in show_json['result']['data']: yield self.url_result( 'https://www.paramountplus.com%s' % episode['url'],