- def decrypt_url(encrypted_url):
- encrypted_url = self._proto_relative_url(
- encrypted_url.replace('{DATA_MARKERS}', ''), 'http:')
- 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))
+ if len(video_id) >= 10:
+ query = {
+ 'v': 2,
+ }
+ qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)
+ t = qs.get('t', [''])[0].split('-')
+ if len(t) > 1:
+ query.update({
+ 's': t[0],
+ 'e': t[1],
+ })
+ else:
+ query = {'v': 1}
+
+ 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