mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	[extractors] Use new framework for existing embeds (#4307)
`Brightcove` is difficult to migrate because it's subclasses may depend on the signature of the current functions. So it is left as-is for now Note: Tests have not been migrated
This commit is contained in:
		| @@ -1,4 +1,3 @@ | ||||
| import re | ||||
| import calendar | ||||
| import json | ||||
| import functools | ||||
| @@ -73,15 +72,10 @@ class PanoptoBaseIE(InfoExtractor): | ||||
|     def _parse_fragment(url): | ||||
|         return {k: json.loads(v[0]) for k, v in compat_urlparse.parse_qs(compat_urllib_parse_urlparse(url).fragment).items()} | ||||
| 
 | ||||
|     @staticmethod | ||||
|     def _extract_urls(webpage): | ||||
|         return [m.group('url') for m in re.finditer( | ||||
|             r'<iframe[^>]+src=["\'](?P<url>%s/Pages/(Viewer|Embed|Sessions/List)\.aspx[^"\']+)' % PanoptoIE.BASE_URL_RE, | ||||
|             webpage)] | ||||
| 
 | ||||
| 
 | ||||
| class PanoptoIE(PanoptoBaseIE): | ||||
|     _VALID_URL = PanoptoBaseIE.BASE_URL_RE + r'/Pages/(Viewer|Embed)\.aspx.*(?:\?|&)id=(?P<id>[a-f0-9-]+)' | ||||
|     _EMBED_REGEX = [rf'<iframe[^>]+src=["\'](?P<url>{PanoptoBaseIE.BASE_URL_RE}/Pages/(Viewer|Embed|Sessions/List)\.aspx[^"\']+)'] | ||||
|     _TESTS = [ | ||||
|         { | ||||
|             'url': 'https://demo.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=26b3ae9e-4a48-4dcc-96ba-0befba08a0fb', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan