Skip to content

Instantly share code, notes, and snippets.

@nihilismus
Created August 25, 2020 21:50
Show Gist options
  • Save nihilismus/4e92005d609539613adffd5fa29c3c3f to your computer and use it in GitHub Desktop.
Save nihilismus/4e92005d609539613adffd5fa29c3c3f to your computer and use it in GitHub Desktop.
Retags the mp3s inside 'Yukito's 1001 Anime OPs & EDs' directory
#!/usr/bin/env bash
# Copyright © 2020 Antonio Hernández Blas <[email protected]>
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://www.wtfpl.net/ for more details.
# Retag-Yukito_s-1001-Anime-OPs-EDs.bash: retags the mp3s inside
# 'Yukito's 1001 Anime OPs & EDs' directory.
#
# For instance:
# - Original tags:
# - Title: Asterisk
# - Artist: Bleach
# - Album: Orange Range
# - New tags:
# - Title: Asterisk [Bleach]
# - Artist: Orange Range
# - Album: Orange Range
retag() {
mp3_file="$1"
title="$(exiftool -title -b "${mp3_file}")"
artist="$(exiftool -artist -b "${mp3_file}")"
album="$(exiftool -album -b "${mp3_file}")"
new_title="${title} ("${artist}")"
new_artist="${album}"
new_album="${album}"
eyeD3 \
--no-color \
--no-config \
--quiet \
--encoding utf16 \
--title="${new_title}" \
--artist="${new_artist}" \
--album="${new_album}" \
"${mp3_file}"
}
#ls -1 *.mp3 | while read line; do
# retag "${line}"
#done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment