]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/hgtv.py
c3f0733cf7708287918d92e95a3e4179f733f4ef
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  12 class HGTVIE(InfoExtractor
): 
  13     _VALID_URL 
= r
'https?://(?:www\.)?hgtv\.ca/[^/]+/video/(?P<id>[^/]+)/video.html' 
  15         'url': 'http://www.hgtv.ca/homefree/video/overnight-success/video.html?v=738081859718&p=1&s=da#video', 
  20             'title': 'Overnight Success', 
  21             'description': 'After weeks of hard work, high stakes, breakdowns and pep talks, the final 2 contestants compete to win the ultimate dream.', 
  22             'uploader': 'SHWM-NEW', 
  23             'timestamp': 1470320034, 
  24             'upload_date': '20160804', 
  28             'skip_download': True, 
  32     def _real_extract(self
, url
): 
  33         display_id 
= self
._match
_id
(url
) 
  34         webpage 
= self
._download
_webpage
(url
, display_id
) 
  35         embed_vars 
= self
._parse
_json
(self
._search
_regex
( 
  36             r
'(?s)embed_vars\s*=\s*({.*?});', 
  37             webpage
, 'embed vars'), display_id
, js_to_json
) 
  39             '_type': 'url_transparent', 
  41                 'http://link.theplatform.com/s/dtjsEC/%s?mbr=true&manifest=m3u' % embed_vars
['pid'], { 
  42                     'force_smil_url': True 
  44             'series': embed_vars
.get('show'), 
  45             'season_number': int_or_none(embed_vars
.get('season')), 
  46             'episode_number': int_or_none(embed_vars
.get('episode')), 
  47             'ie_key': 'ThePlatform',