Skip to content

Instantly share code, notes, and snippets.

@raydive
Created July 8, 2015 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raydive/6783ad869ff058b66e61 to your computer and use it in GitHub Desktop.
Save raydive/6783ad869ff058b66e61 to your computer and use it in GitHub Desktop.
mp4tagsを使って、m4aファイルにタグ付け
# -*- coding: utf-8 -*-
require 'fileutils'
total = Dir::glob(ARGV[0]+"*.m4a").count
ALBUM = "TVアニメ『響け!ユーフォニアム』オリジナルサウンドトラック おもいでミュージック"
Dir::glob(ARGV[0]+"*.m4a").each.with_index(1) do |entry, i|
p entry
new_name = entry.gsub(/(\d+\_)/, '')
FileUtils.mv(entry, new_name)
`mp4tags -g Soundtrack -s "#{File::basename(new_name).gsub(".m4a", '')}" -A "#{ALBUM}" -D 2 -T #{total} -t #{i} "#{new_name}"`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment