aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-03 12:52:27 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-01-03 12:54:19 +0100
commit91d7d0b333d2fe09121c7328cf519c1b5331adef (patch)
tree95e9790db9c1a8adf7969f0e754a5e3408e2554e /youtube_dl/utils.py
parent9887c9b2d62258645de73aa69f18bfff5f540174 (diff)
downloadyoutube-dl-91d7d0b333d2fe09121c7328cf519c1b5331adef.tar.xz
FFmpegMetadataPP; Write temporary file to `something.temp.{ext}` (fixes #2079)
ffmpeg correctly recognize the formats of extensions like m4a, but it doesn’t works if it’s passed with the `—format` option.
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index da5143c8e..fc10fba63 100644
--- 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)