nu774 / fdkaac

command line encoder frontend for libfdk-aac
Other
260 stars 58 forks source link

Please add into README - how to deal with ' in title #38

Closed vitaly-zdanevich closed 5 years ago

vitaly-zdanevich commented 5 years ago

For example now I have this Python code:

title_escaped = title.replace("'", r"'\''")

cmd = fr'''cd /tmp;
        curl {urls} |
        /var/task/oggdec - -o - |
        /var/task/fdkaac -m5 - -o "{episode_filename}"
     --title='{title_escaped}'
     --artist='Intelligent Speaker'
     --album-artist='Intelligent Speaker'
     --album='Intelligent Speaker'
     --genre='Podcast'
     --date='{pubDate}'
     --comment='Voiced text from {source}'
    '''.replace('\n', '')
output_from_shell = subprocess.getoutput(cmd)

But if title with single quote - I get error

/bin/sh: -c: line 0: unexpected EOF while looking for matching `''

nu774 commented 5 years ago

/bin/sh: -c: line 0: unexpected EOF while looking for matching `'' This error message is apparently from the shell (/bin/sh) . In other word you have to learn how to correctly quote/escape arguments for the shell. It has nothing to do with fdkaac.