1 from .common
import InfoExtractor
4 class HGTVComShowIE(InfoExtractor
):
5 IE_NAME
= 'hgtv.com:show'
6 _VALID_URL
= r
'https?://(?:www\.)?hgtv\.com/shows/[^/]+/(?P<id>[^/?#&]+)'
9 'url': 'http://www.hgtv.com/shows/flip-or-flop/flip-or-flop-full-episodes-season-4-videos',
11 'id': 'flip-or-flop-full-episodes-season-4-videos',
12 'title': 'Flip or Flop Full Episodes',
14 'playlist_mincount': 15,
16 # data-deferred-module="video"
17 'url': 'http://www.hgtv.com/shows/good-bones/episodes/an-old-victorian-house-gets-a-new-facelift',
18 'only_matching': True,
21 def _real_extract(self
, url
):
22 display_id
= self
._match
_id
(url
)
24 webpage
= self
._download
_webpage
(url
, display_id
)
26 config
= self
._parse
_json
(
28 r
'(?s)data-(?:deferred-)?module=["\']video
["\'][^>]*>.*?<script[^>]+type=["\']text
/x
-config
["\'][^>]*>(.+?)</script',
29 webpage, 'video config'),
30 display_id)['channels'][0]
33 self.url_result(video['releaseUrl'])
34 for video in config['videos'] if video.get('releaseUrl')]
36 return self.playlist_result(
37 entries, display_id, config.get('title'), config.get('description'))