Fixed some bugs in ArkenaPlay Extractor and made distinction between flv and fmd
This commit is contained in:
parent
32719d16c3
commit
ff32acc9bd
@ -13,10 +13,10 @@ class ArkenaPlayIE(InfoExtractor):
|
|||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://play.lcp.fr/embed/327336/131064/darkmatter/0',
|
'url': 'http://play.lcp.fr/embed/327336/131064/darkmatter/0',
|
||||||
'md5': '6cea4f7d13810464ef8485a924fc3333',
|
'md5': '7d857b1af491ec0f6c2610e52df1ff82',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '327336',
|
'id': '327336',
|
||||||
'url': 're:http://httpod.scdn.arkena.com/11970/327336_[0-9]+.mp4',
|
'url': 're:http://httpod.scdn.arkena.com/11970/327336.*',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': '327336',
|
'title': '327336',
|
||||||
'upload_date': '20160225',
|
'upload_date': '20160225',
|
||||||
@ -40,7 +40,7 @@ class ArkenaPlayIE(InfoExtractor):
|
|||||||
display_id = self._search_regex(self._VALID_URL, url, 'host_name', group='id')
|
display_id = self._search_regex(self._VALID_URL, url, 'host_name', group='id')
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
media_url_regex = '"(?P<mediainfo>(?P<host>.*)/config/avp/.*/\?callbackMethod=\?)"'
|
media_url_regex = '"(?P<mediainfo>(?P<host>.*)/(c|C)onfig/.*\?callbackMethod=\?)"'
|
||||||
media_url = self._html_search_regex(media_url_regex, webpage, 'arkena_media_info_url')
|
media_url = self._html_search_regex(media_url_regex, webpage, 'arkena_media_info_url')
|
||||||
hostname = self._html_search_regex(media_url_regex, webpage, 'arkena_media_host', group='host')
|
hostname = self._html_search_regex(media_url_regex, webpage, 'arkena_media_host', group='host')
|
||||||
if not hostname:
|
if not hostname:
|
||||||
@ -109,8 +109,8 @@ class ArkenaPlayIE(InfoExtractor):
|
|||||||
|
|
||||||
formats.extend(self.__get_mp4_video_formats(media_files))
|
formats.extend(self.__get_mp4_video_formats(media_files))
|
||||||
formats.extend(self.__get_m3u8_video_formats(media_files, video_id))
|
formats.extend(self.__get_m3u8_video_formats(media_files, video_id))
|
||||||
formats.extend(self.__get_f4m_video_formats(media_files, video_id))
|
formats.extend(self.__get_flash_video_formats(media_files, video_id))
|
||||||
# TODO <Other video formats>
|
# TODO <DASH (mpd) formats>
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
@ -133,24 +133,31 @@ class ArkenaPlayIE(InfoExtractor):
|
|||||||
|
|
||||||
def __get_m3u8_video_formats(self, media_files_json, video_id):
|
def __get_m3u8_video_formats(self, media_files_json, video_id):
|
||||||
formats = []
|
formats = []
|
||||||
m3u8_files_json = media_files_json.get("M3u8")
|
m3u8_files_json = media_files_json.get('M3u8')
|
||||||
if not m3u8_files_json:
|
if not m3u8_files_json:
|
||||||
return None
|
return None
|
||||||
for video_info in m3u8_files_json:
|
for video_info in m3u8_files_json:
|
||||||
video_url = video_info.get('Url')
|
video_url = video_info.get('Url')
|
||||||
if not video_url:
|
if not video_url:
|
||||||
continue
|
continue
|
||||||
formats = self._extract_m3u8_formats(video_url, video_id, 'mp4', m3u8_id='hls', fatal=False)
|
formats.extend(self._extract_m3u8_formats(video_url, video_id, 'mp4', m3u8_id='hls', fatal=False))
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
def __get_f4m_video_formats(self, media_files_json, video_id):
|
def __get_flash_video_formats(self, media_files_json, video_id):
|
||||||
formats = []
|
formats = []
|
||||||
f4m_files_json = media_files_json.get("Flash")
|
flash_files_json = media_files_json.get('Flash')
|
||||||
if not f4m_files_json:
|
if not flash_files_json:
|
||||||
return None
|
return None
|
||||||
for video_info in f4m_files_json:
|
for video_info in flash_files_json:
|
||||||
video_url = video_info.get("Url")
|
video_url = video_info.get('Url')
|
||||||
if not video_url:
|
if not video_url:
|
||||||
continue
|
continue
|
||||||
formats = self._extract_f4m_formats(video_url, video_id, 'f4m', f4m_id='hds', fatal=False)
|
video_type = video_info.get('Type')
|
||||||
|
if video_type == 'application/hds+xml':
|
||||||
|
formats.extend(self._extract_f4m_formats(video_url, video_id, f4m_id='hds', fatal=False))
|
||||||
|
elif video_type == 'video/x-flv':
|
||||||
|
formats.append({
|
||||||
|
'url': video_url,
|
||||||
|
'ext': 'flv'
|
||||||
|
})
|
||||||
return formats
|
return formats
|
||||||
|
@ -8,26 +8,15 @@ class LcpIE(InfoExtractor):
|
|||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.lcp.fr/la-politique-en-video/schwartzenberg-prg-preconise-francois-hollande-de-participer-une-primaire',
|
'url': 'http://www.lcp.fr/la-politique-en-video/schwartzenberg-prg-preconise-francois-hollande-de-participer-une-primaire',
|
||||||
'md5': 'aecf5a330cfc1061445a9af5b2df392d',
|
'md5': 'ab96c4dae94322ece1e98d97c8dc7807',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'd56d03e9',
|
'id': 'd56d03e9',
|
||||||
'url': 're:http://httpod.scdn.arkena.com/11970/d56d03e9_[0-9]+.mp4',
|
'url': 're:http://httpod.scdn.arkena.com/11970/d56d03e9_.*',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'd56d03e9',
|
'title': 'd56d03e9',
|
||||||
'upload_date': '20160226',
|
'upload_date': '20160226',
|
||||||
'timestamp': 1456488895
|
'timestamp': 1456488895
|
||||||
}
|
}
|
||||||
}, {
|
|
||||||
'url': 'http://www.lcp.fr/emissions/parlementair',
|
|
||||||
'md5': '9b63769445cbe5f26952bef71f281e8c',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '327499',
|
|
||||||
'url': 're:http://httpod.scdn.arkena.com/11970/327499_[0-9]+.mp4',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': '327499',
|
|
||||||
'upload_date': '20160304',
|
|
||||||
'timestamp': 1457098658
|
|
||||||
}
|
|
||||||
}, {
|
}, {
|
||||||
'url': 'http://www.lcp.fr/le-direct',
|
'url': 'http://www.lcp.fr/le-direct',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user