+
+
+class CNNBlogsIE(InfoExtractor):
+ _VALID_URL = r'https?://[^\.]+\.blogs\.cnn\.com/.+'
+ _TEST = {
+ 'url': 'http://reliablesources.blogs.cnn.com/2014/02/09/criminalizing-journalism/',
+ 'md5': '3e56f97b0b6ffb4b79f4ea0749551084',
+ 'info_dict': {
+ 'id': 'bestoftv/2014/02/09/criminalizing-journalism.cnn',
+ 'ext': 'mp4',
+ 'title': 'Criminalizing journalism?',
+ 'description': 'Glenn Greenwald responds to comments made this week on Capitol Hill that journalists could be criminal accessories.',
+ 'upload_date': '20140209',
+ },
+ 'add_ie': ['CNN'],
+ }
+
+ def _real_extract(self, url):
+ webpage = self._download_webpage(url, url_basename(url))
+ cnn_url = self._html_search_regex(r'data-url="(.+?)"', webpage, 'cnn url')
+ return {
+ '_type': 'url',
+ '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': '689034c2a3d9c6dc4aa72d65a81efd01',
+ 'info_dict': {
+ 'id': 'bestoftv/2014/12/21/ip-north-korea-obama.cnn',
+ 'ext': 'mp4',
+ 'title': 'Obama: Cyberattack not an act of war',
+ 'description': 'md5:51ce6750450603795cad0cdfbd7d05c5',
+ 'upload_date': '20141221',
+ },
+ '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': 'http://cnn.com/video/?/video/' + cnn_url,
+ 'ie_key': CNNIE.ie_key(),
+ }