mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	Completely change project name to yt-dlp (#85)
* All modules and binary names are changed * All documentation references changed * yt-dlp no longer loads youtube-dlc config files * All URLs changed to point to organization account Co-authored-by: Pccode66 Co-authored-by: pukkandan
This commit is contained in:
		
							
								
								
									
										39
									
								
								yt_dlp/extractor/nuevo.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								yt_dlp/extractor/nuevo.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| # coding: utf-8 | ||||
| from __future__ import unicode_literals | ||||
|  | ||||
| from .common import InfoExtractor | ||||
|  | ||||
| from ..utils import ( | ||||
|     float_or_none, | ||||
|     xpath_text | ||||
| ) | ||||
|  | ||||
|  | ||||
| class NuevoBaseIE(InfoExtractor): | ||||
|     def _extract_nuevo(self, config_url, video_id, headers={}): | ||||
|         config = self._download_xml( | ||||
|             config_url, video_id, transform_source=lambda s: s.strip(), | ||||
|             headers=headers) | ||||
|  | ||||
|         title = xpath_text(config, './title', 'title', fatal=True).strip() | ||||
|         video_id = xpath_text(config, './mediaid', default=video_id) | ||||
|         thumbnail = xpath_text(config, ['./image', './thumb']) | ||||
|         duration = float_or_none(xpath_text(config, './duration')) | ||||
|  | ||||
|         formats = [] | ||||
|         for element_name, format_id in (('file', 'sd'), ('filehd', 'hd')): | ||||
|             video_url = xpath_text(config, element_name) | ||||
|             if video_url: | ||||
|                 formats.append({ | ||||
|                     'url': video_url, | ||||
|                     'format_id': format_id, | ||||
|                 }) | ||||
|         self._check_formats(formats, video_id) | ||||
|  | ||||
|         return { | ||||
|             'id': video_id, | ||||
|             'title': title, | ||||
|             'thumbnail': thumbnail, | ||||
|             'duration': duration, | ||||
|             'formats': formats | ||||
|         } | ||||
		Reference in New Issue
	
	Block a user
	 Pccode66
					Pccode66