2 from __future__ import unicode_literals
4 from .adobepass import AdobePassIE
13 class FXNetworksIE(AdobePassIE):
14 _VALID_URL = r'https?://(?:www\.)?(?:fxnetworks|simpsonsworld)\.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'],
30 'url': 'http://www.simpsonsworld.com/video/716094019682',
31 'only_matching': True,
34 def _real_extract(self, url):
35 video_id = self._match_id(url)
36 webpage = self._download_webpage(url, video_id)
37 if 'The content you are trying to access is not available in your region.' in webpage:
38 self.raise_geo_restricted()
39 video_data = extract_attributes(self._search_regex(
40 r'(<a.+?rel="http://link\.theplatform\.com/s/.+?</a>)', webpage, 'video data'))
41 player_type = self._search_regex(r'playerType\s*=\s*[\'"]([^\'"]+)', webpage, 'player type', default=None)
42 release_url = video_data['rel']
43 title = video_data['data-title']
44 rating = video_data.get('data-rating')
48 if player_type == 'movies':
56 if video_data.get('data-req-auth') == '1':
57 resource = self._get_mvpd_resource(
58 video_data['data-channel'], title,
59 video_data.get('data-guid'), rating)
60 query['auth'] = self._extract_mvpd_auth(url, video_id, 'fx', resource)
63 '_type': 'url_transparent',
66 'url': smuggle_url(update_url_query(release_url, query), {'force_smil_url': True}),
67 'thumbnail': video_data.get('data-large-thumb'),
68 'age_limit': parse_age_limit(rating),
69 'ie_key': 'ThePlatform',