]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/bravotv.py
   2 from __future__ 
import unicode_literals
 
   4 from .adobepass 
import AdobePassIE
 
  12 class BravoTVIE(AdobePassIE
): 
  13     _VALID_URL 
= r
'https?://(?:www\.)?bravotv\.com/(?:[^/]+/)+(?P<id>[^/?#]+)' 
  15         'url': 'http://www.bravotv.com/last-chance-kitchen/season-5/videos/lck-ep-12-fishy-finale', 
  16         'md5': '9086d0b7ef0ea2aabc4781d75f4e5863', 
  20             'title': 'LCK Ep 12: Fishy Finale', 
  21             'description': 'S13/E12: Two eliminated chefs have just 12 minutes to cook up a delicious fish dish.', 
  22             'uploader': 'NBCU-BRAV', 
  23             'upload_date': '20160302', 
  24             'timestamp': 1456945320, 
  27         'url': 'http://www.bravotv.com/below-deck/season-3/ep-14-reunion-part-1', 
  28         'only_matching': True, 
  31     def _real_extract(self
, url
): 
  32         display_id 
= self
._match
_id
(url
) 
  33         webpage 
= self
._download
_webpage
(url
, display_id
) 
  34         settings 
= self
._parse
_json
(self
._search
_regex
( 
  35             r
'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);', webpage
, 'drupal settings'), 
  41         account_pid
, release_pid 
= [None] * 2 
  42         tve 
= settings
.get('sharedTVE') 
  44             query
['manifest'] = 'm3u' 
  45             account_pid 
= 'HNK2IC' 
  46             release_pid 
= tve
['release_pid'] 
  47             if tve
.get('entitlement') == 'auth': 
  48                 adobe_pass 
= settings
.get('adobePass', {}) 
  49                 resource 
= self
._get
_mvpd
_resource
( 
  50                     adobe_pass
.get('adobePassResourceId', 'bravo'), 
  51                     tve
['title'], release_pid
, tve
.get('rating')) 
  52                 query
['auth'] = self
._extract
_mvpd
_auth
( 
  53                     url
, release_pid
, adobe_pass
.get('adobePassRequestorId', 'bravo'), resource
) 
  55             shared_playlist 
= settings
['shared_playlist'] 
  56             account_pid 
= shared_playlist
['account_pid'] 
  57             metadata 
= shared_playlist
['video_metadata'][shared_playlist
['default_clip']] 
  58             release_pid 
= metadata
['release_pid'] 
  60                 'title': metadata
['title'], 
  61                 'description': metadata
.get('description'), 
  62                 'season_number': int_or_none(metadata
.get('season_num')), 
  63                 'episode_number': int_or_none(metadata
.get('episode_num')), 
  65             query
['switch'] = 'progressive' 
  67             '_type': 'url_transparent', 
  69             'url': smuggle_url(update_url_query( 
  70                 'http://link.theplatform.com/s/%s/%s' % (account_pid
, release_pid
), 
  71                 query
), {'force_smil_url': True}), 
  72             'ie_key': 'ThePlatform',