aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-04-04 02:09:04 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-04-04 02:09:04 +0200
commit0e518e2fea0e8bd162d53ea6d22720321274abb4 (patch)
treefc5b042018335c409277973ee59b11b42d2b8428 /youtube_dl/extractor
parent1e0a235f39e9076cad94977e5eafc5fbd3ee0be6 (diff)
[cnet] Fall back to "videos" key
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/cnet.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/cnet.py b/youtube_dl/extractor/cnet.py
index 6a2f5ce36..f5ab443d2 100644
--- a/youtube_dl/extractor/cnet.py
+++ b/youtube_dl/extractor/cnet.py
@@ -6,6 +6,7 @@ import re
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
int_or_none,
)
@@ -36,6 +37,10 @@ class CNETIE(InfoExtractor):
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']