1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from .cbs
import CBSBaseIE
11 class ParamountPlusIE(CBSBaseIE
):
15 https?://(?:www\.)?(?:
16 paramountplus\.com/(?:shows/[^/]+/video|movies/[^/]+)/
19 # All tests are blocked outside US
21 'url': 'https://www.paramountplus.com/shows/catdog/video/Oe44g5_NrlgiZE3aQVONleD6vXc8kP0k/catdog-climb-every-catdog-the-canine-mutiny/',
23 'id': 'Oe44g5_NrlgiZE3aQVONleD6vXc8kP0k',
25 'title': 'CatDog - Climb Every CatDog/The Canine Mutiny',
26 'description': 'md5:7ac835000645a69933df226940e3c859',
28 'timestamp': 920264400,
29 'upload_date': '19990301',
30 'uploader': 'CBSI-NEW',
33 'skip_download': 'm3u8',
36 'url': 'https://www.paramountplus.com/shows/tooning-out-the-news/video/6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd/7-23-21-week-in-review-rep-jahana-hayes-howard-fineman-sen-michael-bennet-sheera-frenkel-cecilia-kang-/',
38 'id': '6hSWYWRrR9EUTz7IEe5fJKBhYvSUfexd',
40 'title': '7/23/21 WEEK IN REVIEW (Rep. Jahana Hayes/Howard Fineman/Sen. Michael Bennet/Sheera Frenkel & Cecilia Kang)',
41 'description': 'md5:f4adcea3e8b106192022e121f1565bae',
43 'timestamp': 1627063200,
44 'upload_date': '20210723',
45 'uploader': 'CBSI-NEW',
48 'skip_download': 'm3u8',
51 'url': 'https://www.paramountplus.com/movies/daddys-home/vM2vm0kE6vsS2U41VhMRKTOVHyQAr6pC',
53 'id': 'vM2vm0kE6vsS2U41VhMRKTOVHyQAr6pC',
55 'title': 'Daddy\'s Home',
56 'upload_date': '20151225',
57 'description': 'md5:a0beaf24e8d3b0e81b2ee41d47c06f33',
58 'uploader': 'CBSI-NEW',
59 'timestamp': 1451030400,
62 'skip_download': 'm3u8',
63 'format': 'bestvideo',
65 'expected_warnings': ['Ignoring subtitle tracks'], # TODO: Investigate this
67 'url': 'https://www.paramountplus.com/movies/sonic-the-hedgehog/5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc',
69 'id': '5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc',
71 'uploader': 'CBSI-NEW',
72 'description': 'md5:bc7b6fea84ba631ef77a9bda9f2ff911',
73 'timestamp': 1577865600,
74 'title': 'Sonic the Hedgehog',
75 'upload_date': '20200101',
78 'skip_download': 'm3u8',
79 'format': 'bestvideo',
81 'expected_warnings': ['Ignoring subtitle tracks'],
83 'url': 'https://www.paramountplus.com/shows/all-rise/video/QmR1WhNkh1a_IrdHZrbcRklm176X_rVc/all-rise-space/',
84 'only_matching': True,
86 'url': 'https://www.paramountplus.com/movies/million-dollar-american-princesses-meghan-and-harry/C0LpgNwXYeB8txxycdWdR9TjxpJOsdCq',
87 'only_matching': True,
90 def _extract_video_info(self
, content_id
, mpx_acc
=2198311517):
91 items_data
= self
._download
_json
(
92 'https://www.paramountplus.com/apps-api/v2.0/androidtv/video/cid/%s.json' % content_id
,
93 content_id
, query
={'locale': 'en-us', 'at': 'ABCqWNNSwhIqINWIIAG+DFzcFUvF8/vcN6cNyXFFfNzWAIvXuoVgX+fK4naOC7V8MLI='}
, headers
=self
.geo_verification_headers())
96 item
.get('assetType'): {
98 'formats': 'MPEG4,M3U',
99 } for item
in items_data
['itemList']
101 item
= items_data
['itemList'][-1]
102 return self
._extract
_common
_video
_info
(content_id
, asset_types
, mpx_acc
, extra_info
={
103 'title': item
.get('title'),
104 'series': item
.get('seriesTitle'),
105 'season_number': int_or_none(item
.get('seasonNum')),
106 'episode_number': int_or_none(item
.get('episodeNum')),
107 'duration': int_or_none(item
.get('duration')),
108 'thumbnail': url_or_none(item
.get('thumbnail')),
112 class ParamountPlusSeriesIE(InfoExtractor
):
113 _VALID_URL
= r
'https?://(?:www\.)?paramountplus\.com/shows/(?P<id>[a-zA-Z0-9-_]+)/?(?:[#?]|$)'
115 'url': 'https://www.paramountplus.com/shows/drake-josh',
116 'playlist_mincount': 50,
121 'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
122 'playlist_mincount': 240,
124 'id': 'hawaii_five_0',
127 'url': 'https://www.paramountplus.com/shows/spongebob-squarepants/',
128 'playlist_mincount': 248,
130 'id': 'spongebob-squarepants',
133 _API_URL
= 'https://www.paramountplus.com/shows/{}/xhr/episodes/page/0/size/100000/xs/0/season/0/'
135 def _entries(self
, show_name
):
136 show_json
= self
._download
_json
(self
._API
_URL
.format(show_name
), video_id
=show_name
)
137 if show_json
.get('success'):
138 for episode
in show_json
['result']['data']:
139 yield self
.url_result(
140 'https://www.paramountplus.com%s' % episode
['url'],
141 ie
=ParamountPlusIE
.ie_key(), video_id
=episode
['content_id'])
143 def _real_extract(self
, url
):
144 show_name
= self
._match
_id
(url
)
145 return self
.playlist_result(self
._entries
(show_name
), playlist_id
=show_name
)