- def decrypt_url(encrypted_url):
- encrypted_url = self._proto_relative_url(
- encrypted_url.replace('{DATA_MARKERS}', ''), 'https:')
- key = self._search_regex(
- r'/key=(.*?)%2Cend=', encrypted_url, 'key', default=None)
- if not key:
- return encrypted_url
- return encrypted_url.replace(key, decrypt_key(key))
+ for api_path in ('', 'api.'):
+ video = self._download_json(
+ 'https://%sbeeg.com/api/v6/%s/video/%s'
+ % (api_path, beeg_version, video_id), video_id,
+ fatal=api_path == 'api.', query=query)
+ if video:
+ break