mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[ie/UnitedNationsWebTv] Add extractor (#13538)
Closes #2675 Authored by: averageFOSSenjoyer
This commit is contained in:
		| @@ -2290,6 +2290,7 @@ from .uliza import ( | |||||||
| ) | ) | ||||||
| from .umg import UMGDeIE | from .umg import UMGDeIE | ||||||
| from .unistra import UnistraIE | from .unistra import UnistraIE | ||||||
|  | from .unitednations import UnitedNationsWebTvIE | ||||||
| from .unity import UnityIE | from .unity import UnityIE | ||||||
| from .unsupported import ( | from .unsupported import ( | ||||||
|     KnownDRMIE, |     KnownDRMIE, | ||||||
|   | |||||||
							
								
								
									
										32
									
								
								yt_dlp/extractor/unitednations.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								yt_dlp/extractor/unitednations.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | |||||||
|  | from .common import InfoExtractor | ||||||
|  | from .kaltura import KalturaIE | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class UnitedNationsWebTvIE(InfoExtractor): | ||||||
|  |     _VALID_URL = r'https?://webtv\.un\.org/(?:ar|zh|en|fr|ru|es)/asset/\w+/(?P<id>\w+)' | ||||||
|  |     _TESTS = [{ | ||||||
|  |         'url': 'https://webtv.un.org/en/asset/k1o/k1o7stmi6p', | ||||||
|  |         'md5': 'b2f8b3030063298ae841b4b7ddc01477', | ||||||
|  |         'info_dict': { | ||||||
|  |             'id': '1_o7stmi6p', | ||||||
|  |             'ext': 'mp4', | ||||||
|  |             'title': 'António Guterres (Secretary-General) on Israel and Iran - Security Council, 9939th meeting', | ||||||
|  |             'thumbnail': 'http://cfvod.kaltura.com/p/2503451/sp/250345100/thumbnail/entry_id/1_o7stmi6p/version/100021', | ||||||
|  |             'uploader_id': 'evgeniia.alisova@un.org', | ||||||
|  |             'upload_date': '20250620', | ||||||
|  |             'timestamp': 1750430976, | ||||||
|  |             'duration': 234, | ||||||
|  |             'view_count': int, | ||||||
|  |         }, | ||||||
|  |     }] | ||||||
|  | 
 | ||||||
|  |     def _real_extract(self, url): | ||||||
|  |         video_id = self._match_id(url) | ||||||
|  |         webpage = self._download_webpage(url, video_id) | ||||||
|  | 
 | ||||||
|  |         partner_id = self._html_search_regex( | ||||||
|  |             r'partnerId:\s*(\d+)', webpage, 'partner_id') | ||||||
|  |         entry_id = self._html_search_regex( | ||||||
|  |             r'const\s+kentryID\s*=\s*["\'](\w+)["\']', webpage, 'kentry_id') | ||||||
|  | 
 | ||||||
|  |         return self.url_result(f'kaltura:{partner_id}:{entry_id}', KalturaIE) | ||||||
		Reference in New Issue
	
	Block a user
	 Frank Cai
					Frank Cai