mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 16:45:17 +00:00
[utils] handle int values passed to str_to_int
This commit is contained in:
@ -3519,8 +3519,8 @@ def str_or_none(v, default=None):
|
||||
|
||||
def str_to_int(int_str):
|
||||
""" A more relaxed version of int_or_none """
|
||||
if int_str is None:
|
||||
return None
|
||||
if not isinstance(int_str, compat_str):
|
||||
return int_str
|
||||
int_str = re.sub(r'[,\.\+]', '', int_str)
|
||||
return int(int_str)
|
||||
|
||||
|
Reference in New Issue
Block a user