Compare commits

..

No commits in common. "fd6888d6b291b66eda5850f519baa4854d09e781" and "cc3e61855afcea71bfdfc1e2321a830496c709f0" have entirely different histories.

View File

@ -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}),
}), }),