]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/ondemandkorea.py
2 from __future__
import unicode_literals
6 from . common
import InfoExtractor
13 class OnDemandKoreaIE ( InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html'
15 _GEO_COUNTRIES
= [ 'US' , 'CA' ]
17 'url' : 'https://www.ondemandkorea.com/ask-us-anything-e43.html' ,
19 'id' : 'ask-us-anything-e43' ,
21 'title' : 'Ask Us Anything : Gain, Ji Soo - 09/24/2016' ,
22 'description' : 'A talk show/game show with a school theme where celebrity guests appear as “transfer students.”' ,
23 'thumbnail' : r
're:^https?://.*\.jpg$' ,
26 'skip_download' : 'm3u8 download'
29 'url' : 'https://www.ondemandkorea.com/confession-e01-1.html' ,
31 'id' : 'confession-e01-1' ,
33 'title' : 'Confession : E01' ,
34 'description' : 'Choi Do-hyun, a criminal attorney, is the son of a death row convict. Ever since Choi Pil-su got arrested for murder, Do-hyun has wanted to solve his ' ,
35 'thumbnail' : r
're:^https?://.*\.jpg$' ,
37 'English' : 'mincount:1' ,
41 'skip_download' : 'm3u8 download'
45 def _real_extract ( self
, url
):
46 video_id
= self
._ match
_ id
( url
)
47 webpage
= self
._ download
_ webpage
( url
, video_id
, fatal
= False )
50 # Page sometimes returns captcha page with HTTP 403
52 'Unable to access page. You may have been blocked.' ,
55 if 'msg_block_01.png' in webpage
:
56 self
. raise_geo_restricted (
57 msg
= 'This content is not available in your region' ,
58 countries
= self
._ GEO
_ COUNTRIES
)
60 if 'This video is only available to ODK PLUS members.' in webpage
:
62 'This video is only available to ODK PLUS members.' ,
65 if 'ODK PREMIUM Members Only' in webpage
:
67 'This video is only available to ODK PREMIUM members.' ,
70 title
= self
._ search
_ regex
(
71 r
'class=["\' ] episode_title
[ " \' ][^>]*>([^<]+)',
72 webpage, 'episode_title', fatal=False) or self._og_search_title(webpage)
74 jw_config = self._parse_json(
76 r'playlist\s*=\s*\[(?P<options>.+)];?$',
77 webpage, 'jw config', flags=re.MULTILINE, group='options'),
78 video_id, transform_source=js_to_json)
79 info = self._parse_jwplayer_data(
80 jw_config, video_id, require_title=False, m3u8_id='hls',
85 'description': self._og_search_description(webpage),
86 'thumbnail': self._og_search_thumbnail(webpage)