[DBTV:generic] Add support for embeds

This commit is contained in:
Déstin Reed 2016-08-17 12:45:24 +02:00 committed by Sergey M․
parent 51815886a9
commit b0c8f2e9c8
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D
2 changed files with 17 additions and 0 deletions

View file

@ -38,6 +38,12 @@ class DBTVIE(InfoExtractor):
'only_matching': True, 'only_matching': True,
}] }]
@staticmethod
def _extract_urls(webpage):
return [url for _, url in re.findall(
r'<iframe[^>]+src=(["\'])((?:https?:)?//(?:www\.)?dbtv\.no/lazyplayer/\d+.*?)\1',
webpage)]
def _real_extract(self, url): def _real_extract(self, url):
video_id, display_id = re.match(self._VALID_URL, url).groups() video_id, display_id = re.match(self._VALID_URL, url).groups()

View file

@ -73,6 +73,7 @@ from .eagleplatform import EaglePlatformIE
from .facebook import FacebookIE from .facebook import FacebookIE
from .soundcloud import SoundcloudIE from .soundcloud import SoundcloudIE
from .vbox7 import Vbox7IE from .vbox7 import Vbox7IE
from .dbtv import DBTVIE
class GenericIE(InfoExtractor): class GenericIE(InfoExtractor):
@ -1386,6 +1387,11 @@ class GenericIE(InfoExtractor):
}, },
'add_ie': [Vbox7IE.ie_key()], 'add_ie': [Vbox7IE.ie_key()],
}, },
{
# DBTV embeds
'url': 'http://www.dagbladet.no/2016/02/23/nyheter/nordlys/ski/troms/ver/43254897/',
'playlist_mincount': 3,
},
# { # {
# # TODO: find another test # # TODO: find another test
# # http://schema.org/VideoObject # # http://schema.org/VideoObject
@ -2257,6 +2263,11 @@ class GenericIE(InfoExtractor):
if vbox7_url: if vbox7_url:
return self.url_result(vbox7_url, Vbox7IE.ie_key()) return self.url_result(vbox7_url, Vbox7IE.ie_key())
# Look for DBTV embeds
dbtv_urls = DBTVIE._extract_urls(webpage)
if dbtv_urls:
return _playlist_from_matches(dbtv_urls, ie=DBTVIE.ie_key())
# Looking for http://schema.org/VideoObject # Looking for http://schema.org/VideoObject
json_ld = self._search_json_ld( json_ld = self._search_json_ld(
webpage, video_id, default={}, expected_type='VideoObject') webpage, video_id, default={}, expected_type='VideoObject')