A feature-rich command-line audio/video downloader
[utils] Do not fail in int_or_none on non-numeric data (Closes #7175)
Sergey M․1812afb7b396
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.pyindex 1dc3153fd9..86c6933585 100644--- a/youtube_dl/utils.py+++ b/youtube_dl/utils.py@@ -1371,7 +1371,12 @@ def int_or_none(v, scale=1, default=None, get_attr=None, invscale=1):v = getattr(v, get_attr, None)if v == '':v = None- return default if v is None else (int(v) * invscale // scale)+ if v is None:+ return default+ try:+ return int(v) * invscale // scale+ except ValueError:+ passdef str_or_none(v, default=None):