2 from __future__ import unicode_literals
4 from .adobepass import AdobePassIE
13 class FXNetworksIE(AdobePassIE):
14 _VALID_URL = r'https?://(?:www\.)?fxnetworks\.com/video/(?P<id>\d+)'
16 'url': 'http://www.fxnetworks.com/video/719841347694',
17 'md5': '1447d4722e42ebca19e5232ab93abb22',
22 'description': 'F*ck settling down. You\'re the Worst returns for an all new season August 31st on FXX.',
24 'uploader': 'NEWA-FNG-FX',
25 'upload_date': '20160706',
26 'timestamp': 1467844741,
28 'add_ie': ['ThePlatform'],
31 def _real_extract(self, url):
32 video_id = self._match_id(url)
33 webpage = self._download_webpage(url, video_id)
34 if 'The content you are trying to access is not available in your region.' in webpage:
35 self.raise_geo_restricted()
36 video_data = extract_attributes(self._search_regex(
37 r'(<a.+?rel="http://link\.theplatform\.com/s/.+?</a>)', webpage, 'video data'))
38 player_type = self._search_regex(r'playerType\s*=\s*[\'"]([^\'"]+)', webpage, 'player type', fatal=False)
39 release_url = video_data['rel']
40 title = video_data['data-title']
41 rating = video_data.get('data-rating')
45 if player_type == 'movies':
53 if video_data.get('data-req-auth') == '1':
54 resource = self._get_mvpd_resource(
55 video_data['data-channel'], title,
56 video_data.get('data-guid'), rating)
57 query['auth'] = self._extract_mvpd_auth(url, video_id, 'fx', resource)
60 '_type': 'url_transparent',
63 'url': smuggle_url(update_url_query(release_url, query), {'force_smil_url': True}),
64 'thumbnail': video_data.get('data-large-thumb'),
65 'age_limit': parse_age_limit(rating),
66 'ie_key': 'ThePlatform',