diff --git a/beetsplug/convert.py b/beetsplug/convert.py index 9428fa162..720f7fa1d 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -93,7 +93,7 @@ def encode(source, dest): for arg in command: arg = arg.encode('utf-8') - opts.append(Template(arg).substitute({ + opts.append(Template(arg).safe_substitute({ 'source': source, 'dest': dest, })) diff --git a/docs/plugins/convert.rst b/docs/plugins/convert.rst index 8adbb27f6..5eff02f1e 100644 --- a/docs/plugins/convert.rst +++ b/docs/plugins/convert.rst @@ -83,9 +83,9 @@ These config options control the transcoding process: * ``command`` is the command line to use to transcode audio. A default command, usually using an FFmpeg invocation, is implied by the ``format`` option. The tokens ``$source`` and ``$dest`` in the command are replaced - with the paths to the existing and new file. (Use ``$$`` to emit a literal - dollars sign.) For example, the command ``ffmpeg -i $source -y -aq 4 $dest`` - transcodes to MP3 using FFmpeg at the V4 quality level. + with the paths to the existing and new file. For example, the command + ``ffmpeg -i $source -y -aq 4 $dest`` transcodes to MP3 using FFmpeg at the + V4 quality level. Here's an example configuration::