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',
64 'expected_warnings': ['Ignoring subtitle tracks'], # TODO: Investigate this
66 'url': 'https://www.paramountplus.com/movies/sonic-the-hedgehog/5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc',
68 'id': '5EKDXPOzdVf9voUqW6oRuocyAEeJGbEc',
70 'uploader': 'CBSI-NEW',
71 'description': 'md5:bc7b6fea84ba631ef77a9bda9f2ff911',
72 'timestamp': 1577865600,
73 'title': 'Sonic the Hedgehog',
74 'upload_date': '20200101',
77 'skip_download': 'm3u8',
79 'expected_warnings': ['Ignoring subtitle tracks'],
81 'url': 'https://www.paramountplus.com/shows/all-rise/video/QmR1WhNkh1a_IrdHZrbcRklm176X_rVc/all-rise-space/',
82 'only_matching': True,
84 'url': 'https://www.paramountplus.com/movies/million-dollar-american-princesses-meghan-and-harry/C0LpgNwXYeB8txxycdWdR9TjxpJOsdCq',
85 'only_matching': True,
88 def _extract_video_info(self
, content_id
, mpx_acc
=2198311517):
89 items_data
= self
._download
_json
(
90 'https://www.paramountplus.com/apps-api/v2.0/androidtv/video/cid/%s.json' % content_id
,
91 content_id
, query
={'locale': 'en-us', 'at': 'ABCqWNNSwhIqINWIIAG+DFzcFUvF8/vcN6cNyXFFfNzWAIvXuoVgX+fK4naOC7V8MLI='}
, headers
=self
.geo_verification_headers())
94 item
.get('assetType'): {
96 'formats': 'MPEG4,M3U',
97 } for item
in items_data
['itemList']
99 item
= items_data
['itemList'][-1]
100 return self
._extract
_common
_video
_info
(content_id
, asset_types
, mpx_acc
, extra_info
={
101 'title': item
.get('title'),
102 'series': item
.get('seriesTitle'),
103 'season_number': int_or_none(item
.get('seasonNum')),
104 'episode_number': int_or_none(item
.get('episodeNum')),
105 'duration': int_or_none(item
.get('duration')),
106 'thumbnail': url_or_none(item
.get('thumbnail')),
110 class ParamountPlusSeriesIE(InfoExtractor
):
111 _VALID_URL
= r
'https?://(?:www\.)?paramountplus\.com/shows/(?P<id>[a-zA-Z0-9-_]+)/?(?:[#?]|$)'
113 'url': 'https://www.paramountplus.com/shows/drake-josh',
114 'playlist_mincount': 50,
119 'url': 'https://www.paramountplus.com/shows/hawaii_five_0/',
120 'playlist_mincount': 240,
122 'id': 'hawaii_five_0',
125 'url': 'https://www.paramountplus.com/shows/spongebob-squarepants/',
126 'playlist_mincount': 248,
128 'id': 'spongebob-squarepants',
131 _API_URL
= 'https://www.paramountplus.com/shows/{}/xhr/episodes/page/0/size/100000/xs/0/season/0/'
133 def _entries(self
, show_name
):
134 show_json
= self
._download
_json
(self
._API
_URL
.format(show_name
), video_id
=show_name
)
135 if show_json
.get('success'):
136 for episode
in show_json
['result']['data']:
137 yield self
.url_result(
138 'https://www.paramountplus.com%s' % episode
['url'],
139 ie
=ParamountPlusIE
.ie_key(), video_id
=episode
['content_id'])
141 def _real_extract(self
, url
):
142 show_name
= self
._match
_id
(url
)
143 return self
.playlist_result(self
._entries
(show_name
), playlist_id
=show_name
)