【发布时间】:2020-03-26 19:23:15
【问题描述】:
我经常使用youtube-dl 并且有一个非常简单的文件命名方案:只有小写字母,同一组的东西用“-”(减号、破折号等)连接,而不同的东西用“_”(下划线)。
我不喜欢正则表达式,因此,如果可以根据我的命名方案配置youtube-dl config-file 来存储下载的剪辑,我真的很困惑。例如:
视频:
youtube-dl https://www.youtube.com/watch?v=X8uPIquE5Oo
我的 youtube-dl config:
--output '~/videos/%(uploader)s_%(upload_date)s_%(title)s.%(ext)s' --restrict-filenames
我的输出:
Queen_Forever_20111202_Bohemian_Rhapsody_Live_at_Wembley_11-07-1986.mp4
想要的输出:
queen-forever_20111202_bohemian-rhapsody-live-at-wembley-11-07-1986.mp4
注意:manual says 可能有python options,但我无法将它们转移到我的案例中。
【问题讨论】:
标签: python regex youtube-dl