mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-26 01:01:25 +01:00
Compare commits
1 Commits
717a72f27f
...
e3b1d7d110
Author | SHA1 | Date | |
---|---|---|---|
|
e3b1d7d110 |
|
@ -1,3 +1,4 @@
|
||||||
|
import functools
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
@ -72,17 +73,17 @@ class LiTVIE(InfoExtractor):
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
vod_data = self._search_nextjs_data(webpage, video_id)['props']['pageProps']
|
vod_data = self._search_nextjs_data(webpage, video_id, default={})
|
||||||
|
|
||||||
program_info = traverse_obj(vod_data, ('programInformation', {dict})) or {}
|
program_info = traverse_obj(vod_data, ('props', 'pageProps', 'programInformation', {dict})) or {}
|
||||||
playlist_data = traverse_obj(vod_data, ('seriesTree'))
|
playlist_data = traverse_obj(vod_data, ('props', 'pageProps', 'seriesTree'))
|
||||||
if playlist_data is not None and self._yes_playlist(program_info.get('series_id'), video_id, smuggled_data):
|
if playlist_data is not None and self._yes_playlist(program_info.get('series_id'), video_id, smuggled_data):
|
||||||
return self._extract_playlist(playlist_data, program_info.get('content_type'))
|
return self._extract_playlist(playlist_data, program_info.get('content_type'))
|
||||||
|
|
||||||
asset_id = traverse_obj(program_info, ('assets', 0, 'asset_id', {str}))
|
asset_id = traverse_obj(program_info, ('assets', 0, 'asset_id', {str}))
|
||||||
if asset_id: # This is a VOD
|
if asset_id: # This is a live stream
|
||||||
media_type = 'vod'
|
media_type = 'vod'
|
||||||
else: # This is a live stream
|
else: # This is a VOD
|
||||||
asset_id = program_info['content_id']
|
asset_id = program_info['content_id']
|
||||||
media_type = program_info['content_type']
|
media_type = program_info['content_type']
|
||||||
puid = try_call(lambda: self._get_cookies('https://www.litv.tv/')['PUID'].value)
|
puid = try_call(lambda: self._get_cookies('https://www.litv.tv/')['PUID'].value)
|
||||||
|
@ -116,7 +117,7 @@ class LiTVIE(InfoExtractor):
|
||||||
'title': join_nonempty('title', 'secondary_mark', delim='', from_dict=program_info),
|
'title': join_nonempty('title', 'secondary_mark', delim='', from_dict=program_info),
|
||||||
**traverse_obj(program_info, {
|
**traverse_obj(program_info, {
|
||||||
'description': ('description', {str}),
|
'description': ('description', {str}),
|
||||||
'thumbnail': ('picture', {urljoin('https://p-cdnstatic.svc.litv.tv/')}),
|
'thumbnail': ('picture', {functools.partial(urljoin, 'https://p-cdnstatic.svc.litv.tv/')}),
|
||||||
'categories': ('genres', ..., 'name', {str}),
|
'categories': ('genres', ..., 'name', {str}),
|
||||||
'episode_number': ('episode', {int_or_none}),
|
'episode_number': ('episode', {int_or_none}),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user