icecream 这样命名文件:nnnn-artist-songtitle。
如何将其更改为:艺术家歌曲标题
我想是这样的
冰淇淋 --name="......"
,
但是我找不到方法。我的手册页显示了这一点
冰淇淋/1.3 用法:冰淇淋 [选项] URL [URL...]
options:
-h, --help print this message
-q, --quiet no printouts
-v, --verbose be verbose
-t, --tracks split into tracks when saving
--name=NAME save stream to file NAME. Format codes
are replaced as in the date command.
--stop=N[units] stop download after N (kb, mb, min, songs)
--user-agent=AGENT identify as AGENT stead of icecream/1.3
--stdout output stream to stdout (implies quiet)
--sync sync mpeg audio
--debug turn on debugging
我知道我可以使用带有今天日期的文件名作为输出
icecream -q --name 'radio_%Y_%m_%d' http://radio.com/playlist.pls
我想艺术家和歌曲名称也有这样的 % 代码,但看起来它们没有记录,这正是我的问题
请帮忙。
最佳答案
icecream
是一个 perl 脚本,因此我们可以检查是否确实存在您怀疑的未记录的 %-code。只需打开脚本,看看它是如何完成的(v1.3 中的行 1135
):
$config->{name} = strftime($config->{name},localtime(time));
因此,当您使用 --name
选项时,它唯一做的就是调用 POSIX 函数 strftime()
,as you can see here不会包含任何艺术家或歌曲名称的标签。
为什么你的文件被命名为 nnnn-artist-songtitle
可以在 647
行找到:
my $fn = $trackid . $context->{title};
看起来它从播放列表中获取标题并预先设置一个唯一的 id。如果您不想在名称中包含 id,您可以简单地删除它并只保留 my $fn = $context->{title};
这将按照播放列表中的名称命名文件。但是在此更改之后,不授予唯一性,因此某些文件可能会被覆盖。我建议制作一份 icecream
脚本的副本,并仅在您确定名称唯一的播放列表上使用修改后的版本。
关于linux - 冰淇淋 : how can I make icecream to not name the files starting with a number,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40566050/