2 from __future__ import unicode_literals
6 from .adobepass import AdobePassIE
14 class USANetworkIE(AdobePassIE):
15 _VALID_URL = r'https?://(?:www\.)?usanetwork\.com/(?:[^/]+/videos|movies)/(?P<id>[^/?#]+)'
17 'url': 'http://www.usanetwork.com/mrrobot/videos/hpe-cybersecurity',
18 'md5': '33c0d2ba381571b414024440d08d57fd',
22 'title': 'HPE Cybersecurity',
23 'description': 'The more we digitize our world, the more vulnerable we are.',
24 'upload_date': '20160818',
25 'timestamp': 1471535460,
26 'uploader': 'NBCU-USA',
30 def _real_extract(self, url):
31 display_id = self._match_id(url)
32 webpage = self._download_webpage(url, display_id)
34 player_params = extract_attributes(self._search_regex(
35 r'(<div[^>]+data-usa-tve-player-container[^>]*>)', webpage, 'player params'))
36 video_id = player_params['data-mpx-guid']
37 title = player_params['data-episode-title']
39 account_pid, path = re.search(
40 r'data-src="(?:https?)?//player\.theplatform\.com/p/([^/]+)/.*?/(media/guid/\d+/\d+)',
46 if player_params.get('data-is-full-episode') == '1':
47 query['manifest'] = 'm3u'
49 if player_params.get('data-entitlement') == 'auth':
51 drupal_settings = self._search_regex(
52 r'jQuery\.extend\(Drupal\.settings\s*,\s*({.+?})\);',
53 webpage, 'drupal settings', fatal=False)
55 drupal_settings = self._parse_json(drupal_settings, video_id, fatal=False)
57 adobe_pass = drupal_settings.get('adobePass', {})
58 resource = self._get_mvpd_resource(
59 adobe_pass.get('adobePassResourceId', 'usa'),
60 title, video_id, player_params.get('data-episode-rating', 'TV-14'))
61 query['auth'] = self._extract_mvpd_auth(
62 url, video_id, adobe_pass.get('adobePassRequestorId', 'usa'), resource)
64 info = self._search_json_ld(webpage, video_id, default={})
66 '_type': 'url_transparent',
67 'url': smuggle_url(update_url_query(
68 'http://link.theplatform.com/s/%s/%s' % (account_pid, path),
69 query), {'force_smil_url': True}),
72 'series': player_params.get('data-show-title'),
74 'ie_key': 'ThePlatform',