]> git.bitcoin.ninja Git - youtube-dl/commitdiff
Merge remote-tracking branch 'origin/master'
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 3 Mar 2014 11:34:34 +0000 (12:34 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 3 Mar 2014 11:34:34 +0000 (12:34 +0100)
youtube_dl/YoutubeDL.py
youtube_dl/extractor/__init__.py
youtube_dl/extractor/canal13cl.py [new file with mode: 0644]
youtube_dl/extractor/common.py

index 42cbcf6994567e09b3f35eec3f3f0a71494eb4f5..47205efae69393840f6a200e5722d2a1831753d2 100644 (file)
@@ -675,6 +675,9 @@ class YoutubeDL(object):
             info_dict['playlist'] = None
             info_dict['playlist_index'] = None
 
+        if 'display_id' not in info_dict:
+            info_dict['display_id'] = info_dict['id']
+
         # This extractors handle format selection themselves
         if info_dict['extractor'] in ['Youku']:
             if download:
index 5a6635f8db9638751782e191c89ced242e2e8f5a..e6755151c1b3c7766331b8a87839f8929236c4f6 100644 (file)
@@ -23,6 +23,7 @@ from .br import BRIE
 from .breakcom import BreakIE
 from .brightcove import BrightcoveIE
 from .c56 import C56IE
+from .canal13cl import Canal13clIE
 from .canalplus import CanalplusIE
 from .canalc2 import Canalc2IE
 from .cbs import CBSIE
diff --git a/youtube_dl/extractor/canal13cl.py b/youtube_dl/extractor/canal13cl.py
new file mode 100644 (file)
index 0000000..781c1b5
--- /dev/null
@@ -0,0 +1,32 @@
+from __future__ import unicode_literals
+import re
+
+from .common import InfoExtractor
+
+
+class Canal13clIE(InfoExtractor):
+    _VALID_URL = r'^http://(?:www\.)?13\.cl/'
+    IE_NAME = 'Canal13cl'
+
+    def _real_extract(self, url):
+        webpage = self._download_webpage(url, url)
+        video_id = self._html_search_regex(
+            r'http://streaming.13.cl/(.*)\.mp4',
+            webpage, u'video_id')
+        title = self._html_search_regex(
+            r'(articuloTitulo = \"(.*?)\"|(.*?)\|)',
+            webpage, u'title')
+        url = self._html_search_regex(
+            r'articuloVideo = \"(.*?)\"',
+            webpage, u'url')
+        thumbnail = self._html_search_regex (
+            r'articuloImagen = \"(.*?)\"',
+            webpage, u'thumbnail')
+
+        return {
+            'video_id': video_id,
+            'url': url,
+            'title': title,
+            'ext': 'mp4',
+            'thumbnail': thumbnail
+        }
index 84fca8ba0b2577696877c117a13fcc0a5ce40735..080c9bdfada0440201a85027ddbb34772d09b28f 100644 (file)
@@ -88,6 +88,10 @@ class InfoExtractor(object):
 
     The following fields are optional:
 
+    display_id      An alternative identifier for the video, not necessarily
+                    unique, but available before title. Typically, id is
+                    something like "4234987", title "Dancing naked mole rats",
+                    and display_id "dancing-naked-mole-rats"
     thumbnails:     A list of dictionaries (with the entries "resolution" and
                     "url") for the varying thumbnails
     thumbnail:      Full URL to a video thumbnail image.