[extractor/generic] Add support for svt embeds (Closes #5622)

This commit is contained in:
Sergey M․ 2015-05-09 00:23:35 +06:00
parent 322915014f
commit bab19a8e91
2 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,7 @@ from .condenast import CondeNastIE
from .udn import UDNEmbedIE from .udn import UDNEmbedIE
from .senateisvp import SenateISVPIE from .senateisvp import SenateISVPIE
from .bliptv import BlipTVIE from .bliptv import BlipTVIE
from .svt import SVTIE
class GenericIE(InfoExtractor): class GenericIE(InfoExtractor):
@ -1091,6 +1092,11 @@ class GenericIE(InfoExtractor):
if bliptv_url: if bliptv_url:
return self.url_result(bliptv_url, 'BlipTV') return self.url_result(bliptv_url, 'BlipTV')
# Look for SVT player
svt_url = SVTIE._extract_url(webpage)
if svt_url:
return self.url_result(svt_url, 'SVT')
# Look for embedded condenast player # Look for embedded condenast player
matches = re.findall( matches = re.findall(
r'<iframe\s+(?:[a-zA-Z-]+="[^"]+"\s+)*?src="(https?://player\.cnevids\.com/embed/[^"]+")', r'<iframe\s+(?:[a-zA-Z-]+="[^"]+"\s+)*?src="(https?://player\.cnevids\.com/embed/[^"]+")',

View File

@ -64,6 +64,13 @@ class SVTIE(SVTBaseIE):
}, },
} }
@staticmethod
def _extract_url(webpage):
mobj = re.search(
r'(?:<iframe src|href)="(?P<url>%s[^"]*)"' % SVTIE._VALID_URL, webpage)
if mobj:
return mobj.group('url')
def _real_extract(self, url): def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url) mobj = re.match(self._VALID_URL, url)
widget_id = mobj.group('widget_id') widget_id = mobj.group('widget_id')