aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2016-03-19 11:42:35 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2016-03-19 11:44:49 +0100
commit782b1b5bd1cdaaead6865dee5d300486e7dd8348 (patch)
treec6e1303ba215d1a3ce99233050999be7b1deba7e /youtube_dl/utils.py
parent0d769bcb781b46a00ddf958d6ea945560f2d6cd5 (diff)
downloadyoutube-dl-782b1b5bd1cdaaead6865dee5d300486e7dd8348.tar.xz
[utils] lookup_unit_table: Match word boundary instead of end of string
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index bad1c4ea8..067b8a184 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1346,7 +1346,7 @@ def format_bytes(bytes):
def lookup_unit_table(unit_table, 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)
+ r'(?P<num>[0-9]+(?:[,.][0-9]*)?)\s*(?P<unit>%s)\b' % units_re, s)
if not m:
return None
num_str = m.group('num').replace(',', '.')