77
88class TenPlayIE (InfoExtractor ):
99 IE_NAME = '10play'
10- _VALID_URL = r'https?://(?:www\.)?10play \.com\.au/(?:[^/?#]+/)+(?P<id>tpv\d{6}[a-z]{5})'
10+ _VALID_URL = r'https?://(?:www\.)?10(?:play)? \.com\.au/(?:[^/?#]+/)+(?P<id>tpv\d{6}[a-z]{5})'
1111 _NETRC_MACHINE = '10play'
1212 _TESTS = [{
1313 # Geo-restricted to Australia
14- 'url' : 'https://10play .com.au/australian-survivor/web-extras/season-10-brains-v-brawn-ii/myless-journey/tpv250414jdmtf' ,
14+ 'url' : 'https://10 .com.au/australian-survivor/web-extras/season-10-brains-v-brawn-ii/myless-journey/tpv250414jdmtf' ,
1515 'info_dict' : {
1616 'id' : '7440980000013868' ,
1717 'ext' : 'mp4' ,
@@ -32,7 +32,7 @@ class TenPlayIE(InfoExtractor):
3232 'params' : {'skip_download' : 'm3u8' },
3333 }, {
3434 # Geo-restricted to Australia
35- 'url' : 'https://10play .com.au/neighbours/episodes/season-42/episode-9107/tpv240902nzqyp' ,
35+ 'url' : 'https://10 .com.au/neighbours/episodes/season-42/episode-9107/tpv240902nzqyp' ,
3636 'info_dict' : {
3737 'id' : '9000000000091177' ,
3838 'ext' : 'mp4' ,
@@ -55,7 +55,7 @@ class TenPlayIE(InfoExtractor):
5555 'params' : {'skip_download' : 'm3u8' },
5656 }, {
5757 # Geo-restricted to Australia; upgrading the m3u8 quality fails and we need the fallback
58- 'url' : 'https://10play .com.au/tiny-chef-show/episodes/season-1/episode-2/tpv240228pofvt' ,
58+ 'url' : 'https://10 .com.au/tiny-chef-show/episodes/season-1/episode-2/tpv240228pofvt' ,
5959 'info_dict' : {
6060 'id' : '9000000000084116' ,
6161 'ext' : 'mp4' ,
@@ -77,6 +77,7 @@ class TenPlayIE(InfoExtractor):
7777 },
7878 'params' : {'skip_download' : 'm3u8' },
7979 'expected_warnings' : ['Failed to download m3u8 information: HTTP Error 502' ],
80+ 'skip' : 'video unavailable' ,
8081 }, {
8182 'url' : 'https://10play.com.au/how-to-stay-married/web-extras/season-1/terrys-talks-ep-1-embracing-change/tpv190915ylupc' ,
8283 'only_matching' : True ,
@@ -96,7 +97,7 @@ class TenPlayIE(InfoExtractor):
9697 def _real_extract (self , url ):
9798 content_id = self ._match_id (url )
9899 data = self ._download_json (
99- 'https://10play .com.au/api/v1/videos/' + content_id , content_id )
100+ 'https://10 .com.au/api/v1/videos/' + content_id , content_id )
100101
101102 video_data = self ._download_json (
102103 f'https://vod.ten.com.au/api/videos/bcquery?command=find_videos_by_id&video_id={ data ["altId" ]} ' ,
@@ -137,21 +138,24 @@ def _real_extract(self, url):
137138
138139class TenPlaySeasonIE (InfoExtractor ):
139140 IE_NAME = '10play:season'
140- _VALID_URL = r'https?://(?:www\.)?10play \.com\.au/(?P<show>[^/?#]+)/episodes/(?P<season>[^/?#]+)/?(?:$|[?#])'
141+ _VALID_URL = r'https?://(?:www\.)?10(?:play)? \.com\.au/(?P<show>[^/?#]+)/episodes/(?P<season>[^/?#]+)/?(?:$|[?#])'
141142 _TESTS = [{
142- 'url' : 'https://10play .com.au/masterchef/episodes/season-15' ,
143+ 'url' : 'https://10 .com.au/masterchef/episodes/season-15' ,
143144 'info_dict' : {
144145 'title' : 'Season 15' ,
145146 'id' : 'MTQ2NjMxOQ==' ,
146147 },
147148 'playlist_mincount' : 50 ,
148149 }, {
149- 'url' : 'https://10play .com.au/the-bold-and-the-beautiful-fast-tracked/episodes/season-2024' ,
150+ 'url' : 'https://10 .com.au/the-bold-and-the-beautiful-fast-tracked/episodes/season-2024' ,
150151 'info_dict' : {
151152 'title' : 'Season 2024' ,
152153 'id' : 'Mjc0OTIw' ,
153154 },
154155 'playlist_mincount' : 159 ,
156+ }, {
157+ 'url' : 'https://10play.com.au/the-bold-and-the-beautiful-fast-tracked/episodes/season-2024' ,
158+ 'only_matching' : True ,
155159 }]
156160
157161 def _entries (self , load_more_url , display_id = None ):
@@ -172,7 +176,7 @@ def _entries(self, load_more_url, display_id=None):
172176 def _real_extract (self , url ):
173177 show , season = self ._match_valid_url (url ).group ('show' , 'season' )
174178 season_info = self ._download_json (
175- f'https://10play .com.au/api/shows/{ show } /episodes/{ season } ' , f'{ show } /{ season } ' )
179+ f'https://10 .com.au/api/shows/{ show } /episodes/{ season } ' , f'{ show } /{ season } ' )
176180
177181 episodes_carousel = traverse_obj (season_info , (
178182 'content' , 0 , 'components' , (
0 commit comments