]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/hgtv.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class HGTVComShowIE(InfoExtractor
):
8 IE_NAME
= 'hgtv.com:show'
9 _VALID_URL
= r
'https?://(?:www\.)?hgtv\.com/shows/[^/]+/(?P<id>[^/?#&]+)'
11 'url': 'http://www.hgtv.com/shows/flip-or-flop/flip-or-flop-full-episodes-videos',
13 'id': 'flip-or-flop-full-episodes-videos',
14 'title': 'Flip or Flop Full Episodes',
16 'playlist_mincount': 15,
19 def _real_extract(self
, url
):
20 display_id
= self
._match
_id
(url
)
22 webpage
= self
._download
_webpage
(url
, display_id
)
24 config
= self
._parse
_json
(
26 r
'(?s)data-module=["\']video
["\'][^>]*>.*?<script[^>]+type=["\']text
/x
-config
["\'][^>]*>(.+?)</script',
27 webpage, 'video config'),
28 display_id)['channels'][0]
31 self.url_result(video['releaseUrl'])
32 for video in config['videos'] if video.get('releaseUrl')]
34 return self.playlist_result(
35 entries, display_id, config.get('title'), config.get('description'))