2014-07-17 10:07:51 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
class DFBIE(InfoExtractor):
|
|
|
|
IE_NAME = 'tv.dfb.de'
|
|
|
|
_VALID_URL = r'https?://tv\.dfb\.de/video/[^/]+/(?P<id>\d+)'
|
|
|
|
|
|
|
|
_TEST = {
|
2015-07-14 19:54:13 +02:00
|
|
|
'url': 'http://tv.dfb.de/video/u-19-em-stimmen-zum-spiel-gegen-russland/11633/',
|
2014-07-17 10:07:51 +02:00
|
|
|
# The md5 is different each time
|
|
|
|
'info_dict': {
|
2015-07-14 19:54:13 +02:00
|
|
|
'id': '11633',
|
2014-07-17 10:07:51 +02:00
|
|
|
'ext': 'flv',
|
2015-07-14 19:54:13 +02:00
|
|
|
'title': 'U 19-EM: Stimmen zum Spiel gegen Russland',
|
|
|
|
'upload_date': '20150714',
|
2014-07-17 10:07:51 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
mobj = re.match(self._VALID_URL, url)
|
|
|
|
video_id = mobj.group('id')
|
|
|
|
|
|
|
|
webpage = self._download_webpage(url, video_id)
|
|
|
|
player_info = self._download_xml(
|
|
|
|
'http://tv.dfb.de/server/hd_video.php?play=%s' % video_id,
|
|
|
|
video_id)
|
|
|
|
video_info = player_info.find('video')
|
|
|
|
|
2014-08-16 21:07:04 +02:00
|
|
|
f4m_info = self._download_xml(self._proto_relative_url(video_info.find('url').text.strip()), video_id)
|
2014-07-17 10:07:51 +02:00
|
|
|
token_el = f4m_info.find('token')
|
|
|
|
manifest_url = token_el.attrib['url'] + '?' + 'hdnea=' + token_el.attrib['auth'] + '&hdcore=3.2.0'
|
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'title': video_info.find('title').text,
|
|
|
|
'url': manifest_url,
|
|
|
|
'ext': 'flv',
|
|
|
|
'thumbnail': self._og_search_thumbnail(webpage),
|
|
|
|
'upload_date': ''.join(video_info.find('time_date').text.split('.')[::-1]),
|
|
|
|
}
|