Upgrade yt_dlp and download script
This commit is contained in:
@@ -3,6 +3,7 @@ from ..utils import (
|
||||
float_or_none,
|
||||
int_or_none,
|
||||
parse_iso8601,
|
||||
str_or_none,
|
||||
try_get,
|
||||
)
|
||||
|
||||
@@ -22,7 +23,7 @@ class NineCNineMediaIE(InfoExtractor):
|
||||
title = content['Name']
|
||||
content_package = content['ContentPackages'][0]
|
||||
package_id = content_package['Id']
|
||||
content_package_url = api_base_url + 'contentpackages/%s/' % package_id
|
||||
content_package_url = api_base_url + f'contentpackages/{package_id}/'
|
||||
content_package = self._download_json(
|
||||
content_package_url, content_id, query={
|
||||
'$include': '[HasClosedCaptions]',
|
||||
@@ -73,7 +74,7 @@ class NineCNineMediaIE(InfoExtractor):
|
||||
'episode_number': int_or_none(content.get('Episode')),
|
||||
'season': season.get('Name'),
|
||||
'season_number': int_or_none(season.get('Number')),
|
||||
'season_id': season.get('Id'),
|
||||
'season_id': str_or_none(season.get('Id')),
|
||||
'series': try_get(content, lambda x: x['Media']['Name']),
|
||||
'tags': tags,
|
||||
'categories': categories,
|
||||
@@ -90,7 +91,7 @@ class NineCNineMediaIE(InfoExtractor):
|
||||
}, {
|
||||
'url': manifest_base_url + 'srt',
|
||||
'ext': 'srt',
|
||||
}]
|
||||
}],
|
||||
}
|
||||
|
||||
return info
|
||||
@@ -109,22 +110,21 @@ class CPTwentyFourIE(InfoExtractor):
|
||||
'title': 'WATCH: Truck rips ATM from Mississauga business',
|
||||
'description': 'md5:cf7498480885f080a754389a2b2f7073',
|
||||
'timestamp': 1637618377,
|
||||
'episode_number': None,
|
||||
'season': 'Season 0',
|
||||
'season_number': 0,
|
||||
'season_id': 57974,
|
||||
'season_id': '57974',
|
||||
'series': 'CTV News Toronto',
|
||||
'duration': 26.86,
|
||||
'thumbnail': 'http://images2.9c9media.com/image_asset/2014_11_5_2eb609a0-475b-0132-fbd6-34b52f6f1279_jpg_2000x1125.jpg',
|
||||
'upload_date': '20211122',
|
||||
},
|
||||
'params': {'skip_download': True, 'format': 'bv'}
|
||||
'params': {'skip_download': True, 'format': 'bv'},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
display_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, display_id)
|
||||
id, destination = self._search_regex(
|
||||
video_id, destination = self._search_regex(
|
||||
r'getAuthStates\("(?P<id>[^"]+)",\s?"(?P<destination>[^"]+)"\);',
|
||||
webpage, 'video id and destination', group=('id', 'destination'))
|
||||
return self.url_result(f'9c9media:{destination}:{id}', ie=NineCNineMediaIE.ie_key(), video_id=id)
|
||||
return self.url_result(f'9c9media:{destination}:{video_id}', NineCNineMediaIE, video_id)
|
||||
|
Reference in New Issue
Block a user