嗨,我正在使用GoogleCL version 0.9.11将视频上传到YouTube。我的操作系统是CentOS 5.5和Python 2.5。

字符串参数之一包含新行“ \ n”,并且无法正确显示。

google youtube post ~/videos/cat-falls-down-stairs.avi Comedy --tags "currency of the internet" --summary "Poor whiskers takes a tumble.\nShe's fine, though, don't worry."


摘要页面显示为:

Poor whiskers takes a tumble.\nShe's fine, though, don't worry.


但我想要:

Poor whiskers takes a tumble.
She's fine, though, don't worry.


“ \ n”将不起作用。谁有解决方案?

非常感谢!

最佳答案

您可以使用Bash的$''构造来扩展转义序列,然后再将其传递给googlecl。

google youtube post ~/videos/cat-falls-down-stairs.avi Comedy \
    --tags 'currency of the internet' \
    --summary $'Poor whiskers takes a tumble.\nShe'\''s fine, though, don'\''t worry.'

07-24 14:39