Browse Source

[cnet] Fall back to "videos" key

totalwebcasting
Philipp Hagemeister 11 years ago
parent
commit
0e518e2fea
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      youtube_dl/extractor/cnet.py

+ 5
- 0
youtube_dl/extractor/cnet.py View File

@ -6,6 +6,7 @@ import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ( from ..utils import (
ExtractorError,
int_or_none, int_or_none,
) )
@ -36,6 +37,10 @@ class CNETIE(InfoExtractor):
webpage, 'data json') webpage, 'data json')
data = json.loads(data_json) data = json.loads(data_json)
vdata = data['video'] vdata = data['video']
if not vdata:
vdata = data['videos'][0]
if not vdata:
raise ExtractorError('Cannot find video data')
video_id = vdata['id'] video_id = vdata['id']
title = vdata['headline'] title = vdata['headline']


Loading…
Cancel
Save