Compare commits

..

1 Commits

Author SHA1 Message Date
gillux
e3b1d7d110
Merge cc3e61855a into c699bafc50 2024-11-15 23:21:11 +00:00

View File

@ -1,3 +1,4 @@
import functools
import json
import uuid
@ -72,17 +73,17 @@ class LiTVIE(InfoExtractor):
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 {}
playlist_data = traverse_obj(vod_data, ('seriesTree'))
program_info = traverse_obj(vod_data, ('props', 'pageProps', 'programInformation', {dict})) or {}
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):
return self._extract_playlist(playlist_data, program_info.get('content_type'))
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'
else: # This is a live stream
else: # This is a VOD
asset_id = program_info['content_id']
media_type = program_info['content_type']
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),
**traverse_obj(program_info, {
'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}),
'episode_number': ('episode', {int_or_none}),
}),