]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/nintendo.py
[openload] Add support for oload.win and oload.download
[yt-dlp.git] / youtube_dl / extractor / nintendo.py
CommitLineData
49bc16b9 1# coding: utf-8
a2f9ca1e
T
2from __future__ import unicode_literals
3
49bc16b9
S
4import re
5
a2f9ca1e
T
6from .common import InfoExtractor
7from .ooyala import OoyalaIE
49bc16b9 8from ..utils import unescapeHTML
a2f9ca1e
T
9
10
11class NintendoIE(InfoExtractor):
49bc16b9 12 _VALID_URL = r'https?://(?:www\.)?nintendo\.com/games/detail/(?P<id>[^/?#&]+)'
a2f9ca1e
T
13 _TESTS = [{
14 'url': 'http://www.nintendo.com/games/detail/yEiAzhU2eQI1KZ7wOHhngFoAHc1FpHwj',
15 'info_dict': {
16 'id': 'MzMmticjp0VPzO3CCj4rmFOuohEuEWoW',
17 'ext': 'flv',
18 'title': 'Duck Hunt Wii U VC NES - Trailer',
19 'duration': 60.326,
20 },
21 'params': {
22 'skip_download': True,
23 },
24 'add_ie': ['Ooyala'],
25 }, {
26 'url': 'http://www.nintendo.com/games/detail/tokyo-mirage-sessions-fe-wii-u',
27 'info_dict': {
28 'id': 'tokyo-mirage-sessions-fe-wii-u',
49bc16b9 29 'title': 'Tokyo Mirage Sessions ♯FE',
a2f9ca1e 30 },
49bc16b9 31 'playlist_count': 3,
a2f9ca1e
T
32 }]
33
34 def _real_extract(self, url):
49bc16b9 35 page_id = self._match_id(url)
a2f9ca1e 36
49bc16b9 37 webpage = self._download_webpage(url, page_id)
a2f9ca1e 38
49bc16b9
S
39 entries = [
40 OoyalaIE._build_url_result(m.group('code'))
41 for m in re.finditer(
42 r'class=(["\'])embed-video\1[^>]+data-video-code=(["\'])(?P<code>(?:(?!\2).)+)\2',
43 webpage)]
a2f9ca1e 44
49bc16b9
S
45 return self.playlist_result(
46 entries, page_id, unescapeHTML(self._og_search_title(webpage, fatal=False)))