2 from __future__ import unicode_literals
6 from .brightcove import BrightcoveNewIE
7 from ..utils import update_url_query
10 class SevenPlusIE(BrightcoveNewIE):
12 _VALID_URL = r'https?://(?:www\.)?7plus\.com\.au/(?P<path>[^?]+\?.*?\bepisode-id=(?P<id>[^&#]+))'
14 'url': 'https://7plus.com.au/BEAT?episode-id=BEAT-001',
18 'title': 'S1 E1 - Help / Lucy In The Sky With Diamonds',
19 'description': 'md5:37718bea20a8eedaca7f7361af566131',
20 'uploader_id': '5303576322001',
21 'upload_date': '20171031',
22 'timestamp': 1509440068,
25 'format': 'bestvideo',
26 'skip_download': True,
29 'url': 'https://7plus.com.au/UUUU?episode-id=AUMS43-001',
30 'only_matching': True,
33 def _real_extract(self, url):
34 path, episode_id = re.match(self._VALID_URL, url).groups()
36 media = self._download_json(
37 'https://videoservice.swm.digital/playback', episode_id, query={
40 'platformType': 'web',
41 'accountId': 5303576322001,
42 'referenceId': 'ref:' + episode_id,
47 for source in media.get('sources', {}):
48 src = source.get('src')
51 source['src'] = update_url_query(src, {'rule': ''})
53 info = self._parse_brightcove_metadata(media, episode_id)
55 content = self._download_json(
56 'https://component-cdn.swm.digital/content/' + path,
60 for item in content.get('items', {}):
61 if item.get('componentData', {}).get('componentType') == 'infoPanel':
62 for src_key, dst_key in [('title', 'title'), ('shortSynopsis', 'description')]:
63 value = item.get(src_key)