projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Prepare widespread unicode literal use
[youtube-dl]
/
youtube_dl
/
utils.py
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index da5143c8ef50eb936abc4a7de98c33f7aa10c5b5..fc10fba6327ae17223431da24aae80e341712df3 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-1119,3
+1119,8
@@
def parse_duration(s):
if m.group('hours'):
res += int(m.group('hours')) * 60 * 60
return res
+
+
+def prepend_extension(filename, ext):
+ name, real_ext = os.path.splitext(filename)
+ return u'{0}.{1}{2}'.format(name, ext, real_ext)