2 from __future__ import unicode_literals
6 from .common import InfoExtractor
13 'media': 'http://search.yahoo.com/mrss/',
16 # URL prefix to download the mp4 files directly instead of streaming via rtmp
17 # Credits go to XBox-Maniac
18 # http://board.jdownloader.org/showpost.php?p=185835&postcount=31
19 RAW_MP4_URL = 'http://cdn.riptide-mtvn.com/'
22 class GameOneIE(InfoExtractor):
23 _VALID_URL = r'https?://(?:www\.)?gameone\.de/tv/(?P<id>\d+)'
26 'url': 'http://www.gameone.de/tv/288',
27 'md5': '136656b7fb4c9cb4a8e2d500651c499b',
31 'title': 'Game One - Folge 288',
33 'thumbnail': 'http://s3.gameone.de/gameone/assets/video_metas/teaser_images/000/643/636/big/640x360.jpg',
34 'description': 'FIFA-Pressepokal 2014, Star Citizen, Kingdom Come: Deliverance, Project Cars, Schöner Trants Nerdquiz Folge 2 Runde 1',
36 'upload_date': '20140513',
37 'timestamp': 1399980122,
41 'url': 'http://gameone.de/tv/220',
42 'md5': '5227ca74c4ae6b5f74c0510a7c48839e',
46 'upload_date': '20120918',
47 'description': 'Jet Set Radio HD, Tekken Tag Tournament 2, Source Filmmaker',
48 'timestamp': 1347971451,
49 'title': 'Game One - Folge 220',
57 def _real_extract(self, url):
58 mobj = re.match(self._VALID_URL, url)
59 video_id = mobj.group('id')
61 webpage = self._download_webpage(url, video_id)
62 og_video = self._og_search_video_url(webpage, secure=False)
63 description = self._html_search_meta('description', webpage)
67 self._html_search_meta(
72 mrss_url = self._search_regex(r'mrss=([^&]+)', og_video, 'mrss')
74 mrss = self._download_xml(mrss_url, video_id, 'Downloading mrss')
75 title = mrss.find('.//item/title').text
76 thumbnail = mrss.find('.//item/image').get('url')
77 timestamp = parse_iso8601(mrss.find('.//pubDate').text, delimiter=' ')
78 content = mrss.find(xpath_with_ns('.//media:content', NAMESPACE_MAP))
79 content_url = content.get('url')
81 content = self._download_xml(
84 'Downloading media:content')
85 rendition_items = content.findall('.//rendition')
86 duration = int(rendition_items[0].get('duration').split('.')[0])
89 'url': re.sub(r'.*/(r2)', RAW_MP4_URL + r'\1', r.find('./src').text),
90 'width': int(r.get('width')),
91 'height': int(r.get('height')),
92 'tbr': int(r.get('bitrate')),
94 for r in rendition_items
96 self._sort_formats(formats)
101 'thumbnail': thumbnail,
102 'duration': duration,
104 'description': description,
105 'age_limit': age_limit,
106 'timestamp': timestamp,
110 class GameOnePlaylistIE(InfoExtractor):
111 _VALID_URL = r'https?://(?:www\.)?gameone\.de(?:/tv)?/?$'
112 IE_NAME = 'gameone:playlist'
114 'url': 'http://www.gameone.de/tv',
118 'playlist_mincount': 294,
121 def _real_extract(self, url):
122 webpage = self._download_webpage('http://www.gameone.de/tv', 'TV')
123 max_id = max(map(int, re.findall(r'<a href="/tv/(\d+)"', webpage)))
125 self.url_result('http://www.gameone.de/tv/%d' %
127 for video_id in range(max_id, 0, -1)]