mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[hotstar] fix video data extraction(closes #18386)
This commit is contained in:
parent
8c5879715f
commit
c3c098dcf2
1 changed files with 2 additions and 1 deletions
|
@ -79,7 +79,7 @@ def _real_extract(self, url):
|
||||||
r'<script>window\.APP_STATE\s*=\s*({.+?})</script>',
|
r'<script>window\.APP_STATE\s*=\s*({.+?})</script>',
|
||||||
webpage, 'app state'), video_id)
|
webpage, 'app state'), video_id)
|
||||||
video_data = {}
|
video_data = {}
|
||||||
getters = (
|
getters = list(
|
||||||
lambda x, k=k: x['initialState']['content%s' % k]['content']
|
lambda x, k=k: x['initialState']['content%s' % k]['content']
|
||||||
for k in ('Data', 'Detail')
|
for k in ('Data', 'Detail')
|
||||||
)
|
)
|
||||||
|
@ -87,6 +87,7 @@ def _real_extract(self, url):
|
||||||
content = try_get(v, getters, dict)
|
content = try_get(v, getters, dict)
|
||||||
if content and content.get('contentId') == video_id:
|
if content and content.get('contentId') == video_id:
|
||||||
video_data = content
|
video_data = content
|
||||||
|
break
|
||||||
|
|
||||||
title = video_data['title']
|
title = video_data['title']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue