aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-06 13:36:36 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-06 13:36:36 +0100
commitf53c966a73df42a9a949912ef8ab99a64fb99466 (patch)
treecad9af28cebceabf24ef90085f31b0942e4773f5 /youtube_dl/utils.py
parent336c3a69bd198130e2f65f14dfc83383fec7c5e2 (diff)
[dailymotion] Extract view count (#1895)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index 77609f7ca..7b5878830 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1020,3 +1020,7 @@ def format_bytes(bytes):
suffix = [u'B', u'KiB', u'MiB', u'GiB', u'TiB', u'PiB', u'EiB', u'ZiB', u'YiB'][exponent]
converted = float(bytes) / float(1024 ** exponent)
return u'%.2f%s' % (converted, suffix)
+
+def str_to_int(int_str):
+ int_str = re.sub(r'[,\.]', u'', int_str)
+ return int(int_str)