+ sub_path = player_config.get('subtitles')
+ error = None
+ if not links:
+ links_url = player_config.get('linksurl') or options['videoUrl']
+ token = options['token']
+ self._K = ''.join([random.choice('0123456789abcdef') for _ in range(16)])
+ message = bytes_to_intlist(json.dumps({
+ 'k': self._K,
+ 'e': 60,
+ 't': token,
+ }))
+ padded_message = intlist_to_bytes(pkcs1pad(message, 128))
+ n, e = self._RSA_KEY
+ encrypted_message = long_to_bytes(pow(bytes_to_long(padded_message), e, n))
+ authorization = base64.b64encode(encrypted_message).decode()
+ links_data = self._download_json(
+ urljoin(self._BASE_URL, links_url), video_id, headers={
+ 'Authorization': 'Bearer ' + authorization,
+ })
+ links = links_data.get('links') or {}
+ metas = metas or links_data.get('meta') or {}
+ sub_path = (sub_path or links_data.get('subtitles')) + '&token=' + token
+ error = links_data.get('error')
+ title = metas.get('title') or video_info['title']