3 from .cbs
import CBSBaseIE
4 from .common
import InfoExtractor
12 class ParamountPlusIE(CBSBaseIE
):
16 https?://(?:www\.)?(?:
17 paramountplus\.com/(?:shows|movies)/(?:video|[^/]+/video|[^/]+)/
20 # All tests are blocked outside US
22 'url': 'https://www.paramountplus.com/shows/video/Oe44g5_NrlgiZE3aQVONleD6vXc8kP0k/',
24 'id': 'Oe44g5_NrlgiZE3aQVONleD6vXc8kP0k',
26 'title': 'CatDog - Climb Every CatDog/The Canine Mutiny',
27 'description': 'md5:7ac835000645a69933df226940e3c859',
29 'timestamp': 920264400,
30 'upload_date': '19990301',
31 'uploader': 'CBSI-NEW',
33 'thumbnail': r
're:https?://.+\.jpg$',
35 'chapters': 'count:3',
36 'episode': 'Episode 5',
41 'skip_download': 'm3u8',
44 'url': 'https://www.paramountplus.com/shows/video/6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd/',
46 'id': '6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd',
48 'title': '7/23/21 WEEK IN REVIEW (Rep. Jahana Hayes/Howard Fineman/Sen. Michael Bennet/Sheera Frenkel & Cecilia Kang)',
49 'description': 'md5:f4adcea3e8b106192022e121f1565bae',
51 'timestamp': 1627063200,
52 'upload_date': '20210723',
53 'uploader': 'CBSI-NEW',
55 'thumbnail': r
're:https?://.+\.jpg$',
57 'chapters': 'count:4',
58 'episode': 'Episode 81',
60 'series': 'Tooning Out The News',
63 'skip_download': 'm3u8',
66 'url': 'https://www.paramountplus.com/movies/video/vM2vm0kE6vsS2U41VhMRKTOVHyQAr6pC/',
68 'id': 'vM2vm0kE6vsS2U41VhMRKTOVHyQAr6pC',
70 'title': 'Daddy\'s Home',
71 'upload_date': '20151225',
72 'description': 'md5:9a6300c504d5e12000e8707f20c54745',
73 'uploader': 'CBSI-NEW',
74 'timestamp': 1451030400,
75 'thumbnail': r
're:https?://.+\.jpg$',
76 'chapters': 'count:0',
78 'series': 'Paramount+ Movies',
81 'skip_download': 'm3u8',
85 'url': 'https://www.paramountplus.com/movies/video/5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc/',
87 'id': '5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc',
89 'uploader': 'CBSI-NEW',
90 'description': 'md5:bc7b6fea84ba631ef77a9bda9f2ff911',
91 'timestamp': 1577865600,
92 'title': 'Sonic the Hedgehog',
93 'upload_date': '20200101',
94 'thumbnail': r
're:https?://.+\.jpg$',
95 'chapters': 'count:0',
97 'series': 'Paramount+ Movies',
100 'skip_download': 'm3u8',
104 'url': 'https://www.paramountplus.com/shows/the-real-world/video/mOVeHeL9ub9yWdyzSZFYz8Uj4ZBkVzQg/the-real-world-reunion/',
105 'only_matching': True,
107 'url': 'https://www.paramountplus.com/shows/video/mOVeHeL9ub9yWdyzSZFYz8Uj4ZBkVzQg/',
108 'only_matching': True,
110 'url': 'https://www.paramountplus.com/movies/video/W0VyStQqUnqKzJkrpSAIARuCc9YuYGNy/',
111 'only_matching': True,
113 'url': 'https://www.paramountplus.com/movies/paw-patrol-the-movie/W0VyStQqUnqKzJkrpSAIARuCc9YuYGNy/',
114 'only_matching': True,
117 def _extract_video_info(self
, content_id
, mpx_acc
=2198311517):
118 items_data
= self
._download
_json
(
119 f
'https://www.paramountplus.com/apps-api/v2.0/androidtv/video/cid/{content_id}.json',
122 'at': 'ABCXgPuoStiPipsK0OHVXIVh68zNys+G4f7nW9R6qH68GDOcneW6Kg89cJXGfiQCsj0=',
123 }, headers
=self
.geo_verification_headers())
126 item
.get('assetType'): {
128 'formats': 'M3U+none,MPEG4', # '+none' specifies ProtectionScheme (no DRM)
129 } for item
in items_data
['itemList']
131 item
= items_data
['itemList'][-1]
133 info
, error
= {}, None
135 'title': item
.get('title'),
136 'series': item
.get('seriesTitle'),
137 'season_number': int_or_none(item
.get('seasonNum')),
138 'episode_number': int_or_none(item
.get('episodeNum')),
139 'duration': int_or_none(item
.get('duration')),
140 'thumbnail': url_or_none(item
.get('thumbnail')),
143 info
= self
._extract
_common
_video
_info
(content_id
, asset_types
, mpx_acc
, extra_info
=metadata
)
144 except ExtractorError
as e
:
147 # Check for DRM formats to give appropriate error
148 if not info
.get('formats'):
149 for query
in asset_types
.values():
150 query
['formats'] = 'MPEG-DASH,M3U,MPEG4' # allows DRM formats
153 drm_info
= self
._extract
_common
_video
_info
(content_id
, asset_types
, mpx_acc
, extra_info
=metadata
)
154 except ExtractorError
:
156 raise error
from None
158 if drm_info
['formats']:
159 self
.report_drm(content_id
)
166 class ParamountPlusSeriesIE(InfoExtractor
):
167 _VALID_URL
= r
'https?://(?:www\.)?paramountplus\.com/shows/(?P<id>[a-zA-Z0-9-_]+)/?(?:[#?]|$)'
169 'url': 'https://www.paramountplus.com/shows/drake-josh',
170 'playlist_mincount': 50,
175 'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
176 'playlist_mincount': 240,
178 'id': 'hawaii_five_0',
181 'url': 'https://www.paramountplus.com/shows/spongebob-squarepants/',
182 'playlist_mincount': 248,
184 'id': 'spongebob-squarepants',
188 def _entries(self
, show_name
):
189 for page
in itertools
.count():
190 show_json
= self
._download
_json
(
191 f
'https://www.paramountplus.com/shows/{show_name}/xhr/episodes/page/{page}/size/50/xs/0/season/0', show_name
)
192 if not show_json
.get('success'):
194 for episode
in show_json
['result']['data']:
195 yield self
.url_result(
196 'https://www.paramountplus.com{}'.format(episode
['url']),
197 ie
=ParamountPlusIE
.ie_key(), video_id
=episode
['content_id'])
199 def _real_extract(self
, url
):
200 show_name
= self
._match
_id
(url
)
201 return self
.playlist_result(self
._entries
(show_name
), playlist_id
=show_name
)