0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-23 02:25:11 +00:00

[sportdeutschland] Fix extraction

This commit is contained in:
Philipp Hagemeister 2015-08-16 23:39:50 +02:00
parent cbaed4bb5e
commit c00c7c0af0

View file

@ -38,10 +38,12 @@ class SportDeutschlandIE(InfoExtractor):
'upload_date': '20140825', 'upload_date': '20140825',
'description': 'md5:60a20536b57cee7d9a4ec005e8687504', 'description': 'md5:60a20536b57cee7d9a4ec005e8687504',
'timestamp': 1408976060, 'timestamp': 1408976060,
'duration': 2732,
'title': 'Li-Ning Badminton Weltmeisterschaft 2014 Kopenhagen: Herren Einzel, Wei Lee vs. Keun Lee', 'title': 'Li-Ning Badminton Weltmeisterschaft 2014 Kopenhagen: Herren Einzel, Wei Lee vs. Keun Lee',
'thumbnail': 're:^https?://.*\.jpg$', 'thumbnail': 're:^https?://.*\.jpg$',
'view_count': int, 'view_count': int,
'categories': ['Li-Ning Badminton WM 2014'], 'categories': ['Li-Ning Badminton WM 2014'],
} }
}] }]
@ -50,7 +52,7 @@ def _real_extract(self, url):
video_id = mobj.group('id') video_id = mobj.group('id')
sport_id = mobj.group('sport') sport_id = mobj.group('sport')
api_url = 'http://splink.tv/api/permalinks/%s/%s' % ( api_url = 'http://proxy.vidibusdynamic.net/sportdeutschland.tv/api/permalinks/%s/%s?access_token=true' % (
sport_id, video_id) sport_id, video_id)
req = compat_urllib_request.Request(api_url, headers={ req = compat_urllib_request.Request(api_url, headers={
'Accept': 'application/vnd.vidibus.v2.html+json', 'Accept': 'application/vnd.vidibus.v2.html+json',
@ -58,12 +60,11 @@ def _real_extract(self, url):
}) })
data = self._download_json(req, video_id) data = self._download_json(req, video_id)
categories = list(data.get('section', {}).get('tags', {}).values())
asset = data['asset'] asset = data['asset']
assets_info = self._download_json(asset['url'], video_id) categories = [data['section']['title']]
formats = [] formats = []
smil_url = assets_info['video'] smil_url = asset['video']
if '.smil' in smil_url: if '.smil' in smil_url:
m3u8_url = smil_url.replace('.smil', '.m3u8') m3u8_url = smil_url.replace('.smil', '.m3u8')
formats.extend( formats.extend(
@ -91,6 +92,7 @@ def _real_extract(self, url):
'title': asset['title'], 'title': asset['title'],
'thumbnail': asset.get('image'), 'thumbnail': asset.get('image'),
'description': asset.get('teaser'), 'description': asset.get('teaser'),
'duration': asset.get('duration'),
'categories': categories, 'categories': categories,
'view_count': asset.get('views'), 'view_count': asset.get('views'),
'rtmp_live': asset.get('live'), 'rtmp_live': asset.get('live'),