1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-27 15:16:57 +01:00

[raiplay:live] Add extractor

This commit is contained in:
james 2017-06-17 17:15:41 +02:00 committed by Sergey M․
parent 23aec3d623
commit 449c665776
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D
2 changed files with 19 additions and 1 deletions

View File

@ -824,6 +824,7 @@ from .radiobremen import RadioBremenIE
from .radiofrance import RadioFranceIE
from .rai import (
RaiPlayIE,
RaiPlayLiveIE,
RaiIE,
)
from .rbmaradio import RBMARadioIE

View File

@ -208,10 +208,27 @@ class RaiPlayIE(RaiBaseIE):
}
info.update(relinker_info)
return info
class RaiPlayLiveIE(RaiBaseIE):
_VALID_URL = r'https?://(?:www\.)?raiplay\.it/dirette/(?P<id>\w*)'
_TEST = {
'url': 'http://www.raiplay.it/dirette/rai3',
'only_matching': True,
}
def _real_extract(self, url):
channel = self._match_id(url)
webpage = self._download_webpage(url, channel)
re_id = r'<div([^>]*)data-uniquename=(["\'])[\w-]*(?P<id>%s)(\2)([^>]*?)>' % RaiBaseIE._UUID_RE
video_id = self._html_search_regex(re_id, webpage, 'livestream-id', group='id')
return self.url_result('http://www.raiplay.it/dirette/ContentItem-%s.html' % video_id,
RaiPlayIE.ie_key(), video_id)
class RaiIE(RaiBaseIE):
_VALID_URL = r'https?://[^/]+\.(?:rai\.(?:it|tv)|rainews\.it)/dl/.+?-(?P<id>%s)(?:-.+?)?\.html' % RaiBaseIE._UUID_RE
_TESTS = [{