mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 03:27:06 -05:00 
			
		
		
		
	[utils] Improve encode_dict
This commit is contained in:
		@@ -1668,7 +1668,9 @@ def urlencode_postdata(*args, **kargs):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def encode_dict(d, encoding='utf-8'):
 | 
			
		||||
    return dict((k.encode(encoding), v.encode(encoding)) for k, v in d.items())
 | 
			
		||||
    def encode(v):
 | 
			
		||||
        return v.encode(encoding) if isinstance(v, compat_basestring) else v
 | 
			
		||||
    return dict((encode(k), encode(v)) for k, v in d.items())
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
US_RATINGS = {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user