mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-18 06:09:17 +00:00
[ceskatelevize] update to March 2023 changes (#6539)
Note: we could even skip downloading the player.ceskatelevize.cz page completely as we do not actually need it to get the information we used to need before the recent website changes. However, we would not catch the errors that are handled here and the resulting output could be quite confusing if one of them does happen.
This commit is contained in:
parent
17d248a587
commit
a03cd32b71
|
@ -119,12 +119,10 @@ def _real_extract(self, url):
|
||||||
type_ = 'bonus'
|
type_ = 'bonus'
|
||||||
if not idec:
|
if not idec:
|
||||||
raise ExtractorError('Failed to find IDEC id')
|
raise ExtractorError('Failed to find IDEC id')
|
||||||
iframe_hash = self._download_webpage(
|
sidp = playlist_id.rsplit('-')[0]
|
||||||
'https://www.ceskatelevize.cz/v-api/iframe-hash/',
|
query = {'origin': 'iVysilani', 'autoStart': 'true', 'sidp': sidp, type_: idec, }
|
||||||
playlist_id, note='Getting IFRAME hash')
|
|
||||||
query = {'hash': iframe_hash, 'origin': 'iVysilani', 'autoStart': 'true', type_: idec, }
|
|
||||||
webpage = self._download_webpage(
|
webpage = self._download_webpage(
|
||||||
'https://www.ceskatelevize.cz/ivysilani/embed/iFramePlayer.php',
|
'https://player.ceskatelevize.cz/',
|
||||||
playlist_id, note='Downloading player', query=query)
|
playlist_id, note='Downloading player', query=query)
|
||||||
|
|
||||||
NOT_AVAILABLE_STRING = 'This content is not available at your territory due to limited copyright.'
|
NOT_AVAILABLE_STRING = 'This content is not available at your territory due to limited copyright.'
|
||||||
|
@ -133,29 +131,9 @@ def _real_extract(self, url):
|
||||||
if any(not_found in webpage for not_found in ('Neplatný parametr pro videopřehrávač', 'IDEC nebyl nalezen', )):
|
if any(not_found in webpage for not_found in ('Neplatný parametr pro videopřehrávač', 'IDEC nebyl nalezen', )):
|
||||||
raise ExtractorError('no video with IDEC available', video_id=idec, expected=True)
|
raise ExtractorError('no video with IDEC available', video_id=idec, expected=True)
|
||||||
|
|
||||||
type_ = None
|
|
||||||
episode_id = None
|
|
||||||
|
|
||||||
playlist = self._parse_json(
|
|
||||||
self._search_regex(
|
|
||||||
r'getPlaylistUrl\(\[({.+?})\]', webpage, 'playlist',
|
|
||||||
default='{}'), playlist_id)
|
|
||||||
if playlist:
|
|
||||||
type_ = playlist.get('type')
|
|
||||||
episode_id = playlist.get('id')
|
|
||||||
|
|
||||||
if not type_:
|
|
||||||
type_ = self._html_search_regex(
|
|
||||||
r'getPlaylistUrl\(\[\{"type":"(.+?)","id":".+?"\}\],',
|
|
||||||
webpage, 'type')
|
|
||||||
if not episode_id:
|
|
||||||
episode_id = self._html_search_regex(
|
|
||||||
r'getPlaylistUrl\(\[\{"type":".+?","id":"(.+?)"\}\],',
|
|
||||||
webpage, 'episode_id')
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'playlist[0][type]': type_,
|
'playlist[0][type]': 'episode',
|
||||||
'playlist[0][id]': episode_id,
|
'playlist[0][id]': idec,
|
||||||
'requestUrl': parsed_url.path,
|
'requestUrl': parsed_url.path,
|
||||||
'requestSource': 'iVysilani',
|
'requestSource': 'iVysilani',
|
||||||
}
|
}
|
||||||
|
@ -231,7 +209,7 @@ def _real_extract(self, url):
|
||||||
if item.get('type') == 'VOD':
|
if item.get('type') == 'VOD':
|
||||||
subs = item.get('subtitles')
|
subs = item.get('subtitles')
|
||||||
if subs:
|
if subs:
|
||||||
subtitles = self.extract_subtitles(episode_id, subs)
|
subtitles = self.extract_subtitles(idec, subs)
|
||||||
|
|
||||||
if playlist_len == 1:
|
if playlist_len == 1:
|
||||||
final_title = playlist_title or title
|
final_title = playlist_title or title
|
||||||
|
|
Loading…
Reference in a new issue