mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[twitter] Use _download_xml
This commit is contained in:
		| @@ -8,6 +8,7 @@ from ..compat import compat_urllib_request | |||||||
| from ..utils import ( | from ..utils import ( | ||||||
|     float_or_none, |     float_or_none, | ||||||
|     unescapeHTML, |     unescapeHTML, | ||||||
|  |     xpath_text, | ||||||
| ) | ) | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -60,9 +61,8 @@ class TwitterCardIE(InfoExtractor): | |||||||
|                 video_id) |                 video_id) | ||||||
|             if 'playlist' not in config: |             if 'playlist' not in config: | ||||||
|                 if 'vmapUrl' in config: |                 if 'vmapUrl' in config: | ||||||
|                     webpage = self._download_webpage(config['vmapUrl'], video_id + ' (xml)') |                     vmap_data = self._download_xml(config['vmapUrl'], video_id) | ||||||
|                     video_url = self._search_regex( |                     video_url = xpath_text(vmap_data, './/MediaFile').strip() | ||||||
|                         r'<MediaFile>\s*<!\[CDATA\[(https?://.+?)\]\]>', webpage, 'data player config (xml)') |  | ||||||
|                     f = { |                     f = { | ||||||
|                         'url': video_url, |                         'url': video_url, | ||||||
|                     } |                     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Yen Chi Hsuan
					Yen Chi Hsuan