]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[videa] Add support for videa embeds
authorSergey M․ <dstftw@gmail.com>
Sat, 31 Dec 2016 15:04:29 +0000 (22:04 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 31 Dec 2016 15:05:32 +0000 (22:05 +0700)
youtube_dl/extractor/generic.py
youtube_dl/extractor/videa.py

index 79d10a1d1e3ba9b6665ad83cc63ee32419608cf2..8503966a700e7d091c5d938a890976eae2ab2ce1 100644 (file)
@@ -76,6 +76,7 @@ from .soundcloud import SoundcloudIE
 from .vbox7 import Vbox7IE
 from .dbtv import DBTVIE
 from .piksel import PikselIE
+from .videa import VideaIE
 
 
 class GenericIE(InfoExtractor):
@@ -1422,6 +1423,15 @@ class GenericIE(InfoExtractor):
             },
             'playlist_mincount': 3,
         },
+        {
+            # Videa embeds
+            'url': 'http://forum.dvdtalk.com/movie-talk/623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style.html',
+            'info_dict': {
+                'id': '623756-deleted-magic-star-wars-ot-deleted-alt-scenes-docu-style',
+                'title': 'Deleted Magic - Star Wars: OT Deleted / Alt. Scenes Docu. Style - DVD Talk Forum',
+            },
+            'playlist_mincount': 2,
+        },
         # {
         #     # TODO: find another test
         #     # http://schema.org/VideoObject
@@ -2358,6 +2368,11 @@ class GenericIE(InfoExtractor):
         if dbtv_urls:
             return _playlist_from_matches(dbtv_urls, ie=DBTVIE.ie_key())
 
+        # Look for Videa embeds
+        videa_urls = VideaIE._extract_urls(webpage)
+        if videa_urls:
+            return _playlist_from_matches(videa_urls, ie=VideaIE.ie_key())
+
         # Looking for http://schema.org/VideoObject
         json_ld = self._search_json_ld(
             webpage, video_id, default={}, expected_type='VideoObject')
index 039add86b2d99aa73e886e2e00bab97748a33ded..311df58f4a057ecfd128e76ebfe6f5a692ea0c23 100644 (file)
@@ -1,6 +1,8 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
+import re
+
 from .common import InfoExtractor
 from ..utils import (
     int_or_none,
@@ -43,6 +45,12 @@ class VideaIE(InfoExtractor):
         'only_matching': True,
     }]
 
+    @staticmethod
+    def _extract_urls(webpage):
+        return [url for _, url in re.findall(
+            r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//videa\.hu/player\?.*?\bv=.+?)\1',
+            webpage)]
+
     def _real_extract(self, url):
         video_id = self._match_id(url)