2 from __future__ import unicode_literals
4 from .common import InfoExtractor
13 class GameStarIE(InfoExtractor):
14 _VALID_URL = r'http://www\.gamestar\.de/videos/.*,(?P<id>[0-9]+)\.html'
16 'url': 'http://www.gamestar.de/videos/trailer,3/hobbit-3-die-schlacht-der-fuenf-heere,76110.html',
17 'md5': '96974ecbb7fd8d0d20fca5a00810cea7',
21 'title': 'Hobbit 3: Die Schlacht der Fünf Heere - Teaser-Trailer zum dritten Teil',
22 'description': 'Der Teaser-Trailer zu Hobbit 3: Die Schlacht der Fünf Heere zeigt einige Szenen aus dem dritten Teil der Saga und kündigt den vollständigen Trailer an.',
23 'thumbnail': 'http://images.gamestar.de/images/idgwpgsgp/bdb/2494525/600x.jpg',
24 'upload_date': '20140728',
29 def _real_extract(self, url):
30 video_id = self._match_id(url)
31 webpage = self._download_webpage(url, video_id)
33 og_title = self._og_search_title(webpage)
34 title = og_title.replace(' - Video bei GameStar.de', '').strip()
36 url = 'http://gamestar.de/_misc/videos/portal/getVideoUrl.cfm?premium=0&videoId=' + video_id
38 description = self._og_search_description(webpage).strip()
40 thumbnail = self._proto_relative_url(
41 self._og_search_thumbnail(webpage), scheme='http:')
43 upload_date = unified_strdate(self._html_search_regex(
44 r'<span style="float:left;font-size:11px;">Datum: ([0-9]+\.[0-9]+\.[0-9]+) ',
45 webpage, 'upload_date', fatal=False))
47 duration = parse_duration(self._html_search_regex(
48 r' Länge: ([0-9]+:[0-9]+)</span>', webpage, 'duration',
51 view_count = str_to_int(self._html_search_regex(
52 r' Zuschauer: ([0-9\.]+) ', webpage,
53 'view_count', fatal=False))
55 comment_count = int_or_none(self._html_search_regex(
56 r'>Kommentieren \(([0-9]+)\)</a>', webpage, 'comment_count',
64 'thumbnail': thumbnail,
65 'description': description,
66 'upload_date': upload_date,
68 'view_count': view_count,
69 'comment_count': comment_count