mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 21:07:36 +00:00
Minor fixes
This commit is contained in:
parent
8105f8ed84
commit
35081ecf00
1 changed files with 11 additions and 7 deletions
|
@ -22,15 +22,19 @@ class TeleportalIE(InfoExtractor):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
backend_url = 'https://tp-back.starlight.digital/ua/{}'.format(video_id)
|
backend_url = 'https://tp-back.starlight.digital/ua/{}'.format(video_id)
|
||||||
metadata = self._download_json(backend_url, video_id)
|
metadata = self._download_json(backend_url, video_id)
|
||||||
api_metadata = self._download_json('https://vcms-api2.starlight.digital/player-api/{}?referer=https://teleportal.ua/&lang=ua'.format(metadata["hash"]), video_id)
|
api_metadata = self._download_json('https://vcms-api2.starlight.digital/player-api/{}?referer=https://teleportal.ua/&lang=ua'.format(metadata['hash']), video_id)
|
||||||
|
|
||||||
|
try:
|
||||||
|
thumbnail = api_metadata['video'][0]['poster']
|
||||||
|
except (KeyError, IndexError):
|
||||||
|
thumbnail = None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': metadata['title'],
|
'title': metadata.get('title'),
|
||||||
'description': metadata['description'],
|
'description': metadata.get('description'),
|
||||||
'real_id': metadata['id'],
|
'real_id': metadata.get('id'),
|
||||||
'hash': metadata['hash'],
|
'hash': metadata.get('hash'),
|
||||||
'url': api_metadata['video'][0]['mediaHls'],
|
'thumbnail': thumbnail,
|
||||||
'thumbnail': api_metadata['video'][0]['poster'],
|
|
||||||
'formats': self._extract_m3u8_formats(api_metadata['video'][0]['mediaHls'], video_id, 'mp4'),
|
'formats': self._extract_m3u8_formats(api_metadata['video'][0]['mediaHls'], video_id, 'mp4'),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue