]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ondemandkorea.py
2 from __future__
import unicode_literals
4 from .jwplatform
import JWPlatformBaseIE
11 class OnDemandKoreaIE(JWPlatformBaseIE
):
12 _VALID_URL
= r
'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html'
14 'url': 'http://www.ondemandkorea.com/ask-us-anything-e43.html',
16 'id': 'ask-us-anything-e43',
18 'title': 'Ask Us Anything : E43',
19 'thumbnail': r
're:^https?://.*\.jpg$',
22 'skip_download': 'm3u8 download'
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, video_id
, fatal
=False)
31 # Page sometimes returns captcha page with HTTP 403
33 'Unable to access page. You may have been blocked.',
36 if 'msg_block_01.png' in webpage
:
37 self
.raise_geo_restricted(
38 'This content is not available in your region')
40 if 'This video is only available to ODK PLUS members.' in webpage
:
42 'This video is only available to ODK PLUS members.',
45 title
= self
._og
_search
_title
(webpage
)
47 jw_config
= self
._parse
_json
(
49 r
'(?s)jwplayer\(([\'"])(?:(?!\1).)+\1\)\.setup\s*\((?P<options>.+?)\);',
50 webpage, 'jw config', group='options'),
51 video_id, transform_source=js_to_json)
52 info = self._parse_jwplayer_data(
53 jw_config, video_id, require_title=False, m3u8_id='hls',
58 'thumbnail': self._og_search_thumbnail(webpage),