aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-12-04 17:02:05 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-12-04 17:02:05 +0100
commit4349c07dd7cd07620365b36093f0a148c41ce434 (patch)
tree5e587e06a17c0468a1c7d4e30b4cf08e08954a44 /youtube_dl/utils.py
parent9776bc7f57f061d133b204c056b1cebee775ddad (diff)
[minhateca] Add extractor (Fixes #4094)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 4d3cbac74..5e9ae7a42 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1090,11 +1090,14 @@ def parse_filesize(s):
}
units_re = '|'.join(re.escape(u) for u in _UNIT_TABLE)
- m = re.match(r'(?P<num>[0-9]+(?:\.[0-9]*)?)\s*(?P<unit>%s)' % units_re, s)
+ m = re.match(
+ r'(?P<num>[0-9]+(?:[,.][0-9]*)?)\s*(?P<unit>%s)' % units_re, s)
if not m:
return None
- return int(float(m.group('num')) * _UNIT_TABLE[m.group('unit')])
+ num_str = m.group('num').replace(',', '.')
+ mult = _UNIT_TABLE[m.group('unit')]
+ return int(float(num_str) * mult)
def get_term_width():