-
- # Get link of hd video
- encrypted_video_url = self._html_search_regex(
- r'var encrypted(?:Quality[0-9]+)?URL = \'(?P<encrypted_video_url>[a-zA-Z0-9+/]+={0,2})\';',
- webpage, u'encrypted_video_url')
- video_url = aes_decrypt_text(encrypted_video_url, video_title, 32)
- print(video_url)
- assert isinstance(video_url, compat_str)
- if video_url.split('/')[6].split('_')[0] == u'720p': # only add if 720p to avoid duplicates
- links = [video_url] + links
-
- if not links:
- raise ExtractorError(u'ERROR: no known formats available for video')
-
- self.to_screen(u'Links found: %d' % len(links))
+
+ # Get all encrypted links
+ encrypted_links = re.findall(r'var encryptedQuality[0-9]{3}URL = \'([a-zA-Z0-9+/]+={0,2})\';', webpage)
+ for encrypted_link in encrypted_links:
+ link = aes_decrypt_text(encrypted_link, video_title, 32).decode('utf-8')
+ links.append(link)