about summary refs log tree commit diff
path: root/youtube_dl/extractor/cnn.py
diff options
context:
space:
mode:
authorElan Ruusamäe <glen@pld-linux.org>2019-01-01 18:56:05 +0200
committerSergey M <dstftw@gmail.com>2019-01-01 23:56:05 +0700
commitd226c560a6250d03ff5f27d5b078f894d448a0b4 (patch)
treed81cfb1ad4e3521f8fba2dd80bb02619695684c4 /youtube_dl/extractor/cnn.py
parent8437f5089f2fac85a249c4368c2ea1415955d8b0 (diff)
downloadyoutube-dl-d226c560a6250d03ff5f27d5b078f894d448a0b4.tar.gz
youtube-dl-d226c560a6250d03ff5f27d5b078f894d448a0b4.tar.xz
youtube-dl-d226c560a6250d03ff5f27d5b078f894d448a0b4.zip
Refactor code to use url_result
Diffstat (limited to 'youtube_dl/extractor/cnn.py')
-rw-r--r--youtube_dl/extractor/cnn.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/youtube_dl/extractor/cnn.py b/youtube_dl/extractor/cnn.py
index 5fc311f53..774b71055 100644
--- a/youtube_dl/extractor/cnn.py
+++ b/youtube_dl/extractor/cnn.py
@@ -119,11 +119,7 @@ class CNNBlogsIE(InfoExtractor):
     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(),
-        }
+        return self.url_result(cnn_url, CNNIE.ie_key())
 
 
 class CNNArticleIE(InfoExtractor):
@@ -145,8 +141,4 @@ class CNNArticleIE(InfoExtractor):
     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(),
-        }
+        return self.url_result('http://cnn.com/video/?/video/' + cnn_url, CNNIE.ie_key())