]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fxnetworks.py
   2 from __future__ 
import unicode_literals
 
   4 from .adobepass 
import AdobePassIE
 
  14 class FXNetworksIE(AdobePassIE
): 
  15     _VALID_URL 
= r
'https?://(?:www\.)?(?:fxnetworks|simpsonsworld)\.com/video/(?P<id>\d+)' 
  17         'url': 'http://www.fxnetworks.com/video/1032565827847', 
  18         'md5': '8d99b97b4aa7a202f55b6ed47ea7e703', 
  22             'title': 'First Look: Better Things - Season 2', 
  23             'description': 'Because real life is like a fart. Watch this FIRST LOOK to see what inspired the new season of Better Things.', 
  25             'uploader': 'NEWA-FNG-FX', 
  26             'upload_date': '20170825', 
  27             'timestamp': 1503686274, 
  30             'series': 'Better Things', 
  32         'add_ie': ['ThePlatform'], 
  34         'url': 'http://www.simpsonsworld.com/video/716094019682', 
  35         'only_matching': True, 
  38     def _real_extract(self
, url
): 
  39         video_id 
= self
._match
_id
(url
) 
  40         webpage 
= self
._download
_webpage
(url
, video_id
) 
  41         if 'The content you are trying to access is not available in your region.' in webpage
: 
  42             self
.raise_geo_restricted() 
  43         video_data 
= extract_attributes(self
._search
_regex
( 
  44             r
'(<a.+?rel="https?://link\.theplatform\.com/s/.+?</a>)', webpage
, 'video data')) 
  45         player_type 
= self
._search
_regex
(r
'playerType\s*=\s*[\'"]([^\'"]+)', webpage, 'player 
type', default=None) 
  46         release_url = video_data['rel
'] 
  47         title = video_data['data
-title
'] 
  48         rating = video_data.get('data
-rating
') 
  52         if player_type == 'movies
': 
  60         if video_data.get('data
-req
-auth
') == '1': 
  61             resource = self._get_mvpd_resource( 
  62                 video_data['data
-channel
'], title, 
  63                 video_data.get('data
-guid
'), rating) 
  64             query['auth
'] = self._extract_mvpd_auth(url, video_id, 'fx
', resource) 
  67             '_type
': 'url_transparent
', 
  70             'url
': smuggle_url(update_url_query(release_url, query), {'force_smil_url
': True}), 
  71             'series
': video_data.get('data
-show
-title
'), 
  72             'episode_number
': int_or_none(video_data.get('data
-episode
')), 
  73             'season_number
': int_or_none(video_data.get('data
-season
')), 
  74             'thumbnail
': video_data.get('data
-large
-thumb
'), 
  75             'age_limit
': parse_age_limit(rating), 
  76             'ie_key
': 'ThePlatform
',