mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x (#7178)
Attributes aren't unicode objects, so they couldn't be directly used in info_dict fields (for example '--write-description' doesn't work with bytes).
This commit is contained in:
		| @@ -5,10 +5,10 @@ import io | ||||
| import itertools | ||||
| import os | ||||
| import time | ||||
| import xml.etree.ElementTree as etree | ||||
|  | ||||
| from .fragment import FragmentFD | ||||
| from ..compat import ( | ||||
|     compat_etree_fromstring, | ||||
|     compat_urlparse, | ||||
|     compat_urllib_error, | ||||
|     compat_urllib_parse_urlparse, | ||||
| @@ -290,7 +290,7 @@ class F4mFD(FragmentFD): | ||||
|         man_url = urlh.geturl() | ||||
|         manifest = urlh.read() | ||||
|  | ||||
|         doc = etree.fromstring(manifest) | ||||
|         doc = compat_etree_fromstring(manifest) | ||||
|         formats = [(int(f.attrib.get('bitrate', -1)), f) | ||||
|                    for f in self._get_unencrypted_media(doc)] | ||||
|         if requested_bitrate is None: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jaime Marquínez Ferrándiz
					Jaime Marquínez Ferrándiz