mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-06 02:49:35 +02:00
[utils] Add encode_compat_str
This commit is contained in:
parent
8900ab4d9b
commit
8e60dc7526
@ -1712,6 +1712,10 @@ def encode(v):
|
|||||||
return dict((encode(k), encode(v)) for k, v in d.items())
|
return dict((encode(k), encode(v)) for k, v in d.items())
|
||||||
|
|
||||||
|
|
||||||
|
def encode_compat_str(string, encoding=preferredencoding(), errors='strict'):
|
||||||
|
return string if isinstance(string, compat_str) else compat_str(string, encoding, errors)
|
||||||
|
|
||||||
|
|
||||||
US_RATINGS = {
|
US_RATINGS = {
|
||||||
'G': 0,
|
'G': 0,
|
||||||
'PG': 10,
|
'PG': 10,
|
||||||
|
Loading…
Reference in New Issue
Block a user