1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-14 05:34:32 +01:00

[wdr] Misc changes

This commit is contained in:
Yen Chi Hsuan 2016-06-09 13:49:35 +08:00
parent 6869d634c6
commit 1594a4932f
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30

View File

@ -6,10 +6,10 @@ import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ( from ..utils import (
determine_ext, determine_ext,
ExtractorError,
js_to_json, js_to_json,
strip_jsonp, strip_jsonp,
unified_strdate, unified_strdate,
ExtractorError,
update_url_query, update_url_query,
urlhandle_detect_ext, urlhandle_detect_ext,
) )
@ -17,7 +17,7 @@ from ..utils import (
class WDRIE(InfoExtractor): class WDRIE(InfoExtractor):
_CURRENT_MAUS_URL = r'https?://(?:www\.)wdrmaus.de/(?:[^/]+/){1,2}[^/?#]+\.php5' _CURRENT_MAUS_URL = r'https?://(?:www\.)wdrmaus.de/(?:[^/]+/){1,2}[^/?#]+\.php5'
_PAGE_REGEX = r'/(?:mediathek/)?(?P<media_type>[^/]+)/(?P<type>[^/]+)/(?P<display_id>.+)\.html' _PAGE_REGEX = r'/(?:mediathek/)?[^/]+/(?P<type>[^/]+)/(?P<display_id>.+)\.html'
_VALID_URL = r'(?P<page_url>https?://(?:www\d\.)?wdr\d?\.de)' + _PAGE_REGEX + '|' + _CURRENT_MAUS_URL _VALID_URL = r'(?P<page_url>https?://(?:www\d\.)?wdr\d?\.de)' + _PAGE_REGEX + '|' + _CURRENT_MAUS_URL
_TESTS = [ _TESTS = [
@ -162,10 +162,9 @@ class WDRIE(InfoExtractor):
ext = determine_ext(medium_url) ext = determine_ext(medium_url)
if ext == 'm3u8': if ext == 'm3u8':
m3u_fmt = self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
medium_url, display_id, 'mp4', 'm3u8_native', medium_url, display_id, 'mp4', 'm3u8_native',
m3u8_id='hls') m3u8_id='hls'))
formats.extend(m3u_fmt)
elif ext == 'f4m': elif ext == 'f4m':
manifest_url = update_url_query( manifest_url = update_url_query(
medium_url, {'hdcore': '3.2.0', 'plugin': 'aasp-3.2.0.77.18'}) medium_url, {'hdcore': '3.2.0', 'plugin': 'aasp-3.2.0.77.18'})
@ -185,6 +184,8 @@ class WDRIE(InfoExtractor):
a_format['ext'] = ext a_format['ext'] = ext
formats.append(a_format) formats.append(a_format)
self._sort_formats(formats)
subtitles = {} subtitles = {}
caption_url = metadata_media_resource.get('captionURL') caption_url = metadata_media_resource.get('captionURL')
if caption_url: if caption_url:
@ -206,8 +207,6 @@ class WDRIE(InfoExtractor):
if upload_date: if upload_date:
upload_date = unified_strdate(upload_date) upload_date = unified_strdate(upload_date)
self._sort_formats(formats)
return { return {
'id': metadata_tracker_data.get('trackerClipId', display_id), 'id': metadata_tracker_data.get('trackerClipId', display_id),
'display_id': display_id, 'display_id': display_id,