This website works better with JavaScript.
Home
Help
Sign In
zolfa
/
youtube-dl
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
1.1k
Wiki
Activity
Browse Source
[utils] Do not fail in float_or_none on non-numeric data
totalwebcasting
Sergey M․
9 years ago
parent
1812afb7b3
commit
caf80631f0
1 changed files
with
6 additions
and
1 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-1
youtube_dl/utils.py
+ 6
- 1
youtube_dl/utils.py
View File
@ -1392,7 +1392,12 @@ def str_to_int(int_str):
def
float_or_none
(
v
,
scale
=
1
,
invscale
=
1
,
default
=
None
)
:
def
float_or_none
(
v
,
scale
=
1
,
invscale
=
1
,
default
=
None
)
:
return
default
if
v
is
None
else
(
float
(
v
)
*
invscale
/
scale
)
if
v
is
None
:
return
default
try
:
return
float
(
v
)
*
invscale
/
scale
except
ValueError
:
return
default
def
parse_duration
(
s
)
:
def
parse_duration
(
s
)
:
Write
Preview
Loading…
Cancel
Save