mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-26 09:11:25 +01:00
Compare commits
3 Commits
cc3e61855a
...
fd6888d6b2
Author | SHA1 | Date | |
---|---|---|---|
|
fd6888d6b2 | ||
|
b0f4f71a10 | ||
|
81c2c60073 |
|
@ -1,4 +1,3 @@
|
||||||
import functools
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
@ -73,17 +72,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, default={})
|
vod_data = self._search_nextjs_data(webpage, video_id)['props']['pageProps']
|
||||||
|
|
||||||
program_info = traverse_obj(vod_data, ('props', 'pageProps', 'programInformation', {dict})) or {}
|
program_info = traverse_obj(vod_data, ('programInformation', {dict})) or {}
|
||||||
playlist_data = traverse_obj(vod_data, ('props', 'pageProps', 'seriesTree'))
|
playlist_data = traverse_obj(vod_data, ('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 live stream
|
if asset_id: # This is a VOD
|
||||||
media_type = 'vod'
|
media_type = 'vod'
|
||||||
else: # This is a VOD
|
else: # This is a live stream
|
||||||
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)
|
||||||
|
@ -117,7 +116,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', {functools.partial(urljoin, 'https://p-cdnstatic.svc.litv.tv/')}),
|
'thumbnail': ('picture', {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