mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[cnet] Fall back to "videos" key
This commit is contained in:
parent
1e0a235f39
commit
0e518e2fea
1 changed files with 5 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
int_or_none,
|
||||
)
|
||||
|
||||
|
@ -36,6 +37,10 @@ def _real_extract(self, url):
|
|||
webpage, 'data json')
|
||||
data = json.loads(data_json)
|
||||
vdata = data['video']
|
||||
if not vdata:
|
||||
vdata = data['videos'][0]
|
||||
if not vdata:
|
||||
raise ExtractorError('Cannot find video data')
|
||||
|
||||
video_id = vdata['id']
|
||||
title = vdata['headline']
|
||||
|
|
Loading…
Reference in a new issue