2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import xpath_with_ns
10 'media': 'http://search.yahoo.com/mrss/',
13 # URL prefix to download the mp4 files directly instead of streaming via rtmp
14 # Credits go to XBox-Maniac http://board.jdownloader.org/showpost.php?p=185835&postcount=31
15 RAW_MP4_URL = 'http://cdn.riptide-mtvn.com/'
17 class GameOneIE(InfoExtractor):
18 _VALID_URL = r'https?://(?:www\.)?gameone\.de/tv/(?P<id>\d+)'
20 'url': 'http://www.gameone.de/tv/288',
21 'md5': '136656b7fb4c9cb4a8e2d500651c499b',
25 'title': 'Game One - Folge 288',
27 'thumbnail': 'http://s3.gameone.de/gameone/assets/video_metas/teaser_images/000/643/636/big/640x360.jpg',
31 def _real_extract(self, url):
32 mobj = re.match(self._VALID_URL, url)
33 video_id = mobj.group('id')
35 webpage = self._download_webpage(url, video_id)
36 og_video = self._og_search_video_url(webpage, secure=False)
37 mrss_url = self._search_regex(r'mrss=([^&]+)', og_video, 'mrss')
39 mrss = self._download_xml(mrss_url, video_id, 'Downloading mrss')
40 title = mrss.find('.//item/title').text
41 thumbnail = mrss.find('.//item/image').get('url')
42 content = mrss.find(xpath_with_ns('.//media:content', NAMESPACE_MAP))
43 content_url = content.get('url')
45 content = self._download_xml(content_url, video_id, 'Downloading media:content')
46 rendition_items = content.findall('.//rendition')
47 duration = int(rendition_items[0].get('duration'))
50 'url': re.sub(r'.*/(r2)', RAW_MP4_URL + r'\1', r.find('./src').text),
51 'width': int(r.get('width')),
52 'height': int(r.get('height')),
53 'tbr': int(r.get('bitrate')),
55 for r in rendition_items
61 'thumbnail': thumbnail,