Skip to content

A feature-rich command-line audio/video downloader

[utils] Add None check in str_to_int

Sergey M․c45a6caa95e9
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 64a9618ca6..919603c623 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1194,6 +1194,8 @@ def format_bytes(bytes):
def str_to_int(int_str):
+ if int_str is None:
+ return None
int_str = re.sub(r'[,\.]', u'', int_str)
return int(int_str)