aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2023-06-21 06:49:56 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2023-06-21 09:21:22 +0530
commit1619ab3e67d8dc4f86fc7ed292c79345bc0d91a0 (patch)
tree5f4b479f6e35588896630271fcd0aac32d2912f9 /yt_dlp/YoutubeDL.py
parent84078a8b38f403495d00b46654c8750774d821de (diff)
downloadhypervideo-pre-1619ab3e67d8dc4f86fc7ed292c79345bc0d91a0.tar.lz
hypervideo-pre-1619ab3e67d8dc4f86fc7ed292c79345bc0d91a0.tar.xz
hypervideo-pre-1619ab3e67d8dc4f86fc7ed292c79345bc0d91a0.zip
Bugfix for ebe1b4e34f43c3acad30e4bcb8484681a030c114
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 503aafbc7..bc5c1b95e 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -1328,17 +1328,19 @@ class YoutubeDL:
value = str(value)[0]
else:
fmt = str_fmt
- elif fmt[-1] not in 'rs': # numeric
+ elif fmt[-1] not in 'rsa': # numeric
value = float_or_none(value)
if value is None:
value, fmt = default, 's'
if sanitize:
+ # If value is an object, sanitize might convert it to a string
+ # So we convert it to repr first
if fmt[-1] == 'r':
- # If value is an object, sanitize might convert it to a string
- # So we convert it to repr first
value, fmt = repr(value), str_fmt
- if fmt[-1] in 'csr':
+ elif fmt[-1] == 'a':
+ value, fmt = ascii(value), str_fmt
+ if fmt[-1] in 'csra':
value = sanitizer(initial_field, value)
key = '%s\0%s' % (key.replace('%', '%\0'), outer_mobj.group('format'))