1 from __future__ import unicode_literals
3 from .common import InfoExtractor
6 class NhkVodIE(InfoExtractor):
7 _VALID_URL = r'https?://www3\.nhk\.or\.jp/nhkworld/en/vod/(?P<id>.+?)\.html'
9 # Videos available only for a limited period of time. Visit
10 # http://www3.nhk.or.jp/nhkworld/en/vod/ for working samples.
11 'url': 'http://www3.nhk.or.jp/nhkworld/en/vod/tokyofashion/20160815.html',
13 'id': 'A1bnNiNTE6nY3jLllS-BIISfcC_PpvF5',
15 'title': 'TOKYO FASHION EXPRESS - The Kimono as Global Fashion',
16 'description': 'md5:db338ee6ce8204f415b754782f819824',
17 'series': 'TOKYO FASHION EXPRESS',
18 'episode': 'The Kimono as Global Fashion',
20 'skip': 'Videos available only for a limited period of time',
23 def _real_extract(self, url):
24 video_id = self._match_id(url)
26 webpage = self._download_webpage(url, video_id)
28 embed_code = self._search_regex(
29 r'nw_vod_ooplayer\([^,]+,\s*(["\'])(?P<id>(?:(?!\1).)+)\1',
30 webpage, 'ooyala embed code', group='id')
32 title = self._search_regex(
33 r'<div[^>]+class=["\']episode-detail["\']>\s*<h\d+>([^<]+)',
34 webpage, 'title', default=None)
35 description = self._html_search_regex(
36 r'(?s)<p[^>]+class=["\']description["\'][^>]*>(.+?)</p>',
37 webpage, 'description', default=None)
38 series = self._search_regex(
39 r'<h2[^>]+class=["\']detail-top-player-title[^>]+><a[^>]+>([^<]+)',
40 webpage, 'series', default=None)
43 '_type': 'url_transparent',
45 'url': 'ooyala:%s' % embed_code,
46 'title': '%s - %s' % (series, title) if series and title else title,
47 'description': description,