diff options
author | Sergey M. <dstftw@gmail.com> | 2014-12-29 20:21:39 +0600 |
---|---|---|
committer | Sergey M. <dstftw@gmail.com> | 2014-12-29 20:21:39 +0600 |
commit | 974739aab5935ddf19c005ea084c83a45c855348 (patch) | |
tree | 5b051cd41cc22743401363c871a8db75c9f3dac8 /youtube_dl/extractor/cnn.py | |
parent | ae6986fb895ceb72e084b587bc9d070c86848347 (diff) | |
parent | 9532d723715f1d1a08c126ba8af6940113b88d3b (diff) |
Merge pull request #4543 from akretz/cnn_fix
[cnn] Add support for articles with videos (fixes #4541)
Diffstat (limited to 'youtube_dl/extractor/cnn.py')
-rw-r--r-- | youtube_dl/extractor/cnn.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/youtube_dl/extractor/cnn.py b/youtube_dl/extractor/cnn.py index 81142ee41..cddcacdf1 100644 --- a/youtube_dl/extractor/cnn.py +++ b/youtube_dl/extractor/cnn.py @@ -127,3 +127,28 @@ class CNNBlogsIE(InfoExtractor): 'url': cnn_url, 'ie_key': CNNIE.ie_key(), } + + +class CNNArticleIE(InfoExtractor): + _VALID_URL = r'https?://((edition|www)\.)?cnn\.com/(?!video/)' + _TEST = { + 'url': 'http://www.cnn.com/2014/12/21/politics/obama-north-koreas-hack-not-war-but-cyber-vandalism/', + 'md5': '275b326f85d80dff7592a9820f5dc887', + 'info_dict': { + 'id': 'bestoftv/2014/12/21/sotu-crowley-president-obama-north-korea-not-going-to-be-intimidated.cnn', + 'ext': 'mp4', + 'title': 'Obama: We\'re not going to be intimidated', + 'description': 'md5:e735586f3dc936075fa654a4d91b21f9', + 'upload_date': '20141220', + }, + 'add_ie': ['CNN'], + } + + def _real_extract(self, url): + webpage = self._download_webpage(url, url_basename(url)) + cnn_url = self._html_search_regex(r"video:\s*'([^']+)'", webpage, 'cnn url') + return { + '_type': 'url', + 'url': r'http://cnn.com/video/?/video/' + cnn_url, + 'ie_key': CNNIE.ie_key(), + } |