projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[wdr] Add support for mobile URLs
[youtube-dl]
/
youtube_dl
/
extractor
/
cnet.py
diff --git
a/youtube_dl/extractor/cnet.py
b/youtube_dl/extractor/cnet.py
index 6a2f5ce363a536bc0f87ddf453416f30f2385e30..a94f42571746f21cc70ba2527e661952caca1c6f 100644
(file)
--- 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 (
from .common import InfoExtractor
from ..utils import (
+ ExtractorError,
int_or_none,
)
int_or_none,
)
@@
-32,10
+33,14
@@
class CNETIE(InfoExtractor):
webpage = self._download_webpage(url, display_id)
data_json = self._html_search_regex(
webpage = self._download_webpage(url, display_id)
data_json = self._html_search_regex(
- r"<div class=\"cnetVideoPlayer\"
data-cnet-video-options='([^']+)'",
+ r"<div class=\"cnetVideoPlayer\"
\s+.*?
data-cnet-video-options='([^']+)'",
webpage, 'data json')
data = json.loads(data_json)
vdata = data['video']
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']
video_id = vdata['id']
title = vdata['headline']