Repository: ytdl-org/youtube-dl

Issue:
CNN URL falls back to generic information extractor
URL: "http://www.cnn.com/2014/12/21/politics/obama-north-koreas-hac
k-not-war-but-cyber-vandalism/"

youtube-dl -v "http://www.cnn.com/2014/12/21/politics/obama-north-koreas-hac
k-not-war-but-cyber-vandalism/"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://www.cnn.com/2014/12/21/politics/obama-
north-koreas-hack-not-war-but-cyber-vandalism/']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2014.12.17.2
[debug] Python version 2.7.8 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-40824-g31dfe20
[debug] Proxy map: {}
[generic] obama-north-koreas-hack-not-war-but-cyber-vandalism: Requesting header

WARNING: Falling back on generic information extractor.
[generic] obama-north-koreas-hack-not-war-but-cyber-vandalism: Downloading webpa
ge
[generic] obama-north-koreas-hack-not-war-but-cyber-vandalism: Extracting inform
ation
ERROR: Unsupported URL: http://www.cnn.com/2014/12/21/politics/obama-north-korea
s-hack-not-war-but-cyber-vandalism/; please report this issue on https://yt-dl.o
rg/bug . Make sure you are using the latest version; type  youtube-dl -U  to upd
ate. Be sure to call youtube-dl with the --verbose flag and include its complete
 output.
Traceback (most recent call last):
  File "youtube_dl\extractor\generic.pyo", line 660, in _real_extract
  File "youtube_dl\utils.pyo", line 1444, in parse_xml
  File "xml\etree\ElementTree.pyo", line 1300, in XML
  File "xml\etree\ElementTree.pyo", line 1642, in feed
  File "xml\etree\ElementTree.pyo", line 1506, in _raiseerror
ParseError: not well-formed (invalid token): line 2, column 16
Traceback (most recent call last):
  File "youtube_dl\YoutubeDL.pyo", line 592, in extract_info
  File "youtube_dl\extractor\common.pyo", line 243, in extract
  File "youtube_dl\extractor\generic.pyo", line 1060, in _real_extract
ExtractorError: Unsupported URL: http://www.cnn.com/2014/12/21/politics/obama-no
rth-koreas-hack-not-war-but-cyber-vandalism/; please report this issue on https:
//yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -
U  to update. Be sure to call youtube-dl with the --verbose flag and include its
 complete output.

Thanks...
RIngo



Discussion:

Resolving patch:
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -64,6 +64,7 @@
 from .cnn import (
     CNNIE,
     CNNBlogsIE,
+    CNNArticleIE,
 )
 from .collegehumor import CollegeHumorIE
 from .comedycentral import ComedyCentralIE, ComedyCentralShowsIE
diff --git a/youtube_dl/extractor/cnn.py b/youtube_dl/extractor/cnn.py
--- a/youtube_dl/extractor/cnn.py
+++ b/youtube_dl/extractor/cnn.py
@@ -127,3 +127,28 @@ def _real_extract(self, 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': '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(),
+        }


Test patch: