2 from __future__ import unicode_literals
4 from .adobepass import AdobePassIE
12 class FOXIE(AdobePassIE):
13 _VALID_URL = r'https?://(?:www\.)?fox\.com/watch/(?P<id>[0-9]+)'
15 'url': 'http://www.fox.com/watch/255180355939/7684182528',
16 'md5': 'ebd296fcc41dd4b19f8115d8461a3165',
20 'title': 'Official Trailer: Gotham',
21 'description': 'Tracing the rise of the great DC Comics Super-Villains and vigilantes, Gotham reveals an entirely new chapter that has never been told.',
23 'timestamp': 1400020798,
24 'upload_date': '20140513',
25 'uploader': 'NEWA-FNG-FOXCOM',
27 'add_ie': ['ThePlatform'],
30 def _real_extract(self, url):
31 video_id = self._match_id(url)
32 webpage = self._download_webpage(url, video_id)
34 settings = self._parse_json(self._search_regex(
35 r'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
36 webpage, 'drupal settings'), video_id)
37 fox_pdk_player = settings['fox_pdk_player']
38 release_url = fox_pdk_player['release_url']
43 if fox_pdk_player.get('access') == 'locked':
44 ap_p = settings['foxAdobePassProvider']
45 rating = ap_p.get('videoRating')
48 resource = self._get_mvpd_resource('fbc-fox', None, ap_p['videoGUID'], rating)
49 query['auth'] = self._extract_mvpd_auth(url, video_id, 'fbc-fox', resource)
51 info = self._search_json_ld(webpage, video_id, fatal=False)
53 '_type': 'url_transparent',
54 'ie_key': 'ThePlatform',
55 'url': smuggle_url(update_url_query(release_url, query), {'force_smil_url': True}),