2 from __future__ import unicode_literals
5 import xml.etree.ElementTree as ET
7 from .common import InfoExtractor
8 from ..utils import xpath_with_ns
11 'media': 'http://search.yahoo.com/mrss/',
14 # URL prefix to download the mp4 files directly instead of streaming via rtmp
15 # Credits go to XBox-Maniac http://board.jdownloader.org/showpost.php?p=185835&postcount=31
16 RAW_MP4_URL = 'http://cdn.riptide-mtvn.com/'
18 class GameOneIE(InfoExtractor):
19 _VALID_URL = r'https?://(?:www\.)?gameone\.de/tv/(?P<id>\d+)'
21 'url': 'http://www.gameone.de/tv/288',
22 'md5': '136656b7fb4c9cb4a8e2d500651c499b',
26 'title': 'Game One - Folge 288',
28 'thumbnail': 'http://s3.gameone.de/gameone/assets/video_metas/teaser_images/000/643/636/big/640x360.jpg',
29 'description': 'FIFA-Pressepokal 2014, Star Citizen, Kingdom Come: Deliverance, Project Cars, Schöner Trants Nerdquiz Folge 2 Runde 1',
33 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 video_id = mobj.group('id')
37 webpage = self._download_webpage(url, video_id)
38 og_video = self._og_search_video_url(webpage, secure=False)
39 description = self._html_search_meta('description', webpage)
40 mrss_url = self._search_regex(r'mrss=([^&]+)', og_video, 'mrss')
42 mrss = self._download_xml(mrss_url, video_id, 'Downloading mrss')
43 title = mrss.find('.//item/title').text
44 thumbnail = mrss.find('.//item/image').get('url')
45 content = mrss.find(xpath_with_ns('.//media:content', NAMESPACE_MAP))
46 content_url = content.get('url')
48 content = self._download_xml(content_url, video_id, 'Downloading media:content')
49 rendition_items = content.findall('.//rendition')
50 duration = int(rendition_items[0].get('duration'))
53 'url': re.sub(r'.*/(r2)', RAW_MP4_URL + r'\1', r.find('./src').text),
54 'width': int(r.get('width')),
55 'height': int(r.get('height')),
56 'tbr': int(r.get('bitrate')),
58 for r in rendition_items
64 'thumbnail': thumbnail,
67 'description': description,