id3 тагер (посоветуйте)
Модератор: Модераторы разделов
-
vonabarak
- Сообщения: 146
id3 тагер
Посоветуйте какой-нибудь хороший сабж. Пробовал EasyTag и jTagger, не нашел последние удобными. Видел один оч хороший экземплярчик, называется TagScanner, но он для Виндовс онли. Вот хотелось бы что-то с похожим интерфейсом.
Йа тьомный эльф
-
Nymin
- Сообщения: 1095
- Статус: -
- ОС: GNU/Linux
Re: id3 тагер
все таки EasyTag, от упомянутого TagScanner судя по скриншотам отличается только в лучшую сторону
-
Cornet
- Сообщения: 214
- Статус: Status quo
- ОС: Debain "Lenny"
Re: id3 тагер
С похожим интерфейсом не знаю, но это работает четко и очень корректно!!
Для полного конвертирования всей музыкальной библиотеки будем использовать скрипт mid3iconv, который поставляется в комплекте пакета python-mutagen. Для правильной работы пакет python-mutagen должен быть версией не ниже 1.1.
1. Устанавливаем пакет python-mutagen:
Debian, Ubuntu, Kubuntu..:
# sudo apt-get install python-mutagen
2. Переходим в директорию с Вашей музыкальной библиотекой:
# cd /home/ВАШ_ЛОГИН/Музыка
Возможно директория с музыкальной библиотекой у Вас будет другой.
3. Конвертируем библиотеку:
# find -iname '*.mp3' -print0 | xargs -0 mid3iconv -eCP1251 --remove-v1
В результате всех вышеизложенных действий ОС Linux и MP3-плеер будут нормально воспринимать кириллические теги MP3-файлов. При прослушивании интернет радиостанций названия русских песен будут правильно выводится.
Для полного конвертирования всей музыкальной библиотеки будем использовать скрипт mid3iconv, который поставляется в комплекте пакета python-mutagen. Для правильной работы пакет python-mutagen должен быть версией не ниже 1.1.
1. Устанавливаем пакет python-mutagen:
Debian, Ubuntu, Kubuntu..:
# sudo apt-get install python-mutagen
2. Переходим в директорию с Вашей музыкальной библиотекой:
# cd /home/ВАШ_ЛОГИН/Музыка
Возможно директория с музыкальной библиотекой у Вас будет другой.
3. Конвертируем библиотеку:
# find -iname '*.mp3' -print0 | xargs -0 mid3iconv -eCP1251 --remove-v1
В результате всех вышеизложенных действий ОС Linux и MP3-плеер будут нормально воспринимать кириллические теги MP3-файлов. При прослушивании интернет радиостанций названия русских песен будут правильно выводится.
AMD64 Phentom 8450 Triple-Core, 4Gb Ram, 500 +1000Gb HDD, LCD 240HD, Geforce-9800 GT,
Ubuntu 11.10 3.0.0-14-amd64 sovetunion.ru
Ubuntu 11.10 3.0.0-14-amd64 sovetunion.ru
-
Nymin
- Сообщения: 1095
- Статус: -
- ОС: GNU/Linux
Re: id3 тагер
Cornet
мой любимый скрипт, но мимо кассы. топиккастер спрашивал о другом.
мой любимый скрипт, но мимо кассы. топиккастер спрашивал о другом.
-
Палач
- Сообщения: 624
- Статус: ASUS Eee 1000HE
- ОС: Gentoo ~x86 / Simply 5.0
Re: id3 тагер
TagScanner прекрасно работает из под wine.
-
Black
- Сообщения: 1104
- ОС: ArchLinux
Re: id3 тагер
Если подойдет cli, то вот мой. Нужны: mutagen (для mp3), vorbistools (для ogg), flac (для flac). Как пользоваться - см. флаг "-h". Одно "но": написано под zsh, под bash не проверял, скорее всего надо будет что-то править.
Код:
#!/bin/zsh
#commandline options {{{
while getopts "RrOT:An:N:a:b:y:g:t:ih" Option
do
case $Option in
R) RECODEONLY=1;; # only recode tags from cp1251 to utf-8
r) RENAME=1;; # also rename files as $num - $title
O) RENAMEONLY=1;; # only rename files
T) _template=$OPTARG;;
A) ASKTITLE=1;; # ask for title for each file
n) _num=$OPTARG;; # number of file
N) _totnum=$OPTARG;; # total number of files
a) _artist=$OPTARG;;
b) _album=$OPTARG;;
y) _year=$OPTARG;;
g) _genre=$OPTARG;;
t) _title=$OPTARG;;
i) SHOWINFO=1;; # only show existing tags
h) # help message {{{
echo -e "NAME
$(basename $0) - tool for read/write tags and rename flac, ogg and mp3 files.
SYNOPSIS
- Show tags:
$(basename $0) -i file1 [file2 file3 ...]
- Fill tags:
$(basename $0) [-a 'Artist'] [-b 'Album'] [-y year] [-g genre] [-n track number] [-N total tracks] [-t 'Song title'|-A] file1 [file2 file3 ...]
- Recode tags:
$(basename $0) -R file1 [file2 file3 ...]
- Rename files:
$(basename $0) -r [-T 'template'] file 1 [file 2 file 3 ...]
OPTIONS
-i
Show tags.
-a 'Artist'
-b 'Album'
-y year
-g 'Genre'
-t 'Song title'
Fill the apropriate fields. If more then wone file specified, the
same tags will be written to all these files.
-A
Ask the song title for each file.
-n number
Track number. If more then one file specified, number will growing
up by 1 for each file. If not specified, files will be numbered
from 1 in sort order.
-N number
Total tracks number. If not specified, number of files will be
written.
-O
Only rename files, do not fill empty tags.
-R
Recode tags from CP1251 to utf-8.
-r
Rename files (filling empty tags).
-T 'template'
Template for renaming files. Contains:
\$num - number of files;
\$totnum - total number of files;
\$artist - artist;
\$album - album;
\$genre - genre;
\$year - year;
\$title - song title.
If template not specified, then used '\$num - \$title'.
-h
Show this help message.
EXAMPLES
- fill tags of mp3 files and rename it:
$(basename $0) -rA -a 'Behemoth' -b 'Grom' -y 1996 -g 'Black Metal' *
- rename files with template:
$(basename $0) -r -T '\$num - \$artist - \$title (\$album, \$year)' *
AUTHOR
dclxvi (dclxvi at xakep dot ru, dclxvi at jabber dot ru) " | less
exit 0
#}}}
;;
esac
done
shift $(($OPTIND - 1)) #}}}
files=($*)
if [[ -z $files ]]
then
echo "Nothing to do. Exiting..."
exit 1
fi
# if $_totnum is specified, use it. else use number of arguments
if [[ -n $_totnum ]]
then totnum=$_totnum
else totnum=$#
fi
# BUG! If unsupported file specified, it will be counted too.
filltag() {
# if $_num is specified, use it, else use 1.
if [[ -n $_num ]]
then num=$_num
else num=1
fi
for i in $files
do
case $i in
*.mp3|*.MP3|*.Mp3)
fmt=mp3
TITLE=$(mid3v2 $i)
# read existing song title
extitle=$(echo $TITLE | grep -ae '^TIT2' | cut -d '=' -f 2)
# first, read tags from commandline if specified
[[ -n $_artist ]] && artist=$_artist
[[ -n $_album ]] && album=$_album
[[ -n $_year ]] && year=$_year
[[ -n $_genre ]] && genre=$_genre
# second, read existing titles
[[ -z $artist ]] && artist=$(echo $TITLE | grep -ae '^TPE1' | cut -d '=' -f 2)
[[ -z $album ]] && album=$(echo $TITLE | grep -ae '^TALB' | cut -d '=' -f 2)
[[ -z $year ]] && year=$(echo $TITLE | grep -ae '^TDRC' | cut -d '=' -f 2)
[[ -z $genre ]] && genre=$(echo $TITLE | grep -ae '^TCON' | cut -d '=' -f 2)
# third, if none, then use 'Unknown'
[[ -z $artist ]] && artist="Unknown"
[[ -z $album ]] && album="Unknown"
[[ -z $year ]] && year="666"
[[ -z $genre ]] && genre="Unknown"
# if option -A is used, ask for song title.
if [[ $ASKTITLE -eq 1 ]]
then
echo -n "$num/$totnum: Song title for $i [$extitle]: "
read title
fi
# try to use existing title. if not exists, use "Track No"
[[ -z $title ]] && title=$extitle
[[ -z $title ]] && title="Track $(printf %.2d $num)"
# write tags
mid3v2 -a "$artist" -A "$album" -y "$year" -g "$genre" -t "$title" -T$(printf "%.2d" $num)/$(printf "%.2d" $totnum) "$i" 1>/dev/null
;;
*.ogg|*.OGG|*.Ogg)
fmt=ogg
TITLE=$(vorbiscomment -l $i)
# read existing song title
extitle=$(echo $TITLE | grep -aie '^title' | cut -d '=' -f 2)
# first, read tags from commandline if specified
[[ -n $_artist ]] && artist=$_artist
[[ -n $_album ]] && album=$_album
[[ -n $_year ]] && year=$_year
[[ -n $_genre ]] && genre=$_genre
# second, read existing titles
[[ -z $artist ]] && artist=$(echo $TITLE | grep -aie '^artist' | cut -d '=' -f 2)
[[ -z $album ]] && album=$(echo $TITLE | grep -aie '^album' | cut -d '=' -f 2)
[[ -z $year ]] && year=$(echo $TITLE | grep -aie '^date' | cut -d '=' -f 2)
[[ -z $genre ]] && genre=$(echo $TITLE | grep -aie '^genre' | cut -d '=' -f 2)
# third, if none, then use 'Unknown'
[[ -z $artist ]] && artist="Unknown"
[[ -z $album ]] && album="Unknown"
[[ -z $year ]] && year="666"
[[ -z $genre ]] && genre="Unknown"
# if option -A is used, ask for song title.
if [[ $ASKTITLE -eq 1 ]]
then
echo -n "$num/$totnum: Song title for $i [$extitle]: "
read title
fi
# try to use existing title. if not exists, use "Track No"
[[ -z $title ]] && title=$extitle
[[ -z $title ]] && title="Track $(printf %.2d $num)"
# write tags
vorbiscomment -w "$i" -t ARTIST="$artist" -t ALBUM="$album" -t DATE="$year" -t GENRE="$genre" -t TRACKNUMBER=$(printf %.2d $num) -t TRACKTOTAL=$(printf %.2d $totnum) -t TITLE="$title" 1>/dev/null
;;
*.flac|*.FLAC|*.Flac)
fmt=flac
TITLE=$(metaflac $i --export-tags-to=-)
# read existing song title
extitle=$(echo $TITLE | grep -aie '^title' | cut -d '=' -f 2)
# first, read tags from commandline if specified
[[ -n $_artist ]] && artist=$_artist
[[ -n $_album ]] && album=$_album
[[ -n $_year ]] && year=$_year
[[ -n $_genre ]] && genre=$_genre
# second, read existing titles
[[ -z $artist ]] && artist=$(echo $TITLE | grep -aie '^artist' | cut -d '=' -f 2)
[[ -z $album ]] && album=$(echo $TITLE | grep -aie '^album' | cut -d '=' -f 2)
[[ -z $year ]] && year=$(echo $TITLE | grep -aie '^date' | cut -d '=' -f 2)
[[ -z $genre ]] && genre=$(echo $TITLE | grep -aie '^genre' | cut -d '=' -f 2)
# if none, then use 'Unknown'
[[ -z $artist ]] && artist="Unknown"
[[ -z $album ]] && album="Unknown"
[[ -z $year ]] && year="666"
[[ -z $genre ]] && genre="Unknown"
# if option -A is used, ask for song title.
if [[ $ASKTITLE -eq 1 ]]
then
echo -n "$num/$totnum: Song title for $i [$extitle]: "
read title
fi
# try to use existing title. if not exists, use "Track No"
[[ -z $title ]] && title=$extitle
[[ -z $title ]] && title="Track $(printf %.2d $num)"
# write tags
metaflac "$i" --remove-tag=ARTIST --remove-tag=ALBUM --remove-tag=DATE --remove-tag=GENRE --remove-tag=TRACKNUMBER --remove-tag=TRACKTOTAL --remove-tag=TITLE 1>/dev/null
metaflac "$i" --set-tag=ARTIST="$artist" --set-tag=ALBUM="$album" --set-tag=DATE="$year" --set-tag=GENRE="$genre" --set-tag=TRACKNUMBER=$(printf %.2d $num) --set-tag=TRACKTOTAL=$(printf %.2d $totnum) --set-tag=TITLE="$title" 1>/dev/null
;;
*)
echo "Unknown file type: $i"
;;
esac
if [[ $RENAME -eq 1 ]] && [[ -n $fmt ]]
then
if [[ -n $_template ]]
then
# replace $num with $(printf %.02d $num) and all special symbols with "_"
template=$(echo $_template | sed -e 's/\$num/\$(printf %\.02d \$num)/g' -e 's/\$totnum/\$(printf %\.02d \$totnum)/g')
template=$(eval echo $template | sed "s/[@#$%^&*=\`\'\"\/\|\\ ]/_/g")
else
# template is just $num-$title
template="$(printf %.02d $num)-$(echo $title | sed "s/[@#$%^&*=\`\'\"\/\|\\ ]/_/g")"
fi
mv "$i" "$(dirname $i)/$template.$fmt"
fi
let "num += 1"
# null variables for use with next file
title=
artist=
album=
year=
genre=
fmt=
done
}
renameonly() {
for i in $files
do
case $i in
*.mp3|*.MP3|*.Mp3)
fmt=mp3
TITLE=$(mid3v2 $i)
artist=$(echo $TITLE | grep -ae '^TPE1' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -ae '^TALB' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -ae '^TDRC' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -ae '^TCON' | cut -d '=' -f 2)
num=$(echo $TITLE | grep -ae '^TRCK' | cut -d '=' -f 2 | cut -d '/' -f 1)
title=$(echo $TITLE | grep -ae '^TIT2' | cut -d '=' -f 2)
;;
*.ogg|*.OGG|*.Ogg)
fmt=ogg
TITLE=$(vorbiscomment -l $i)
artist=$(echo $TITLE | grep -aie '^ARTIST' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -aie '^ALBUM' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -aie '^DATE' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -aie '^GENRE' | cut -d '=' -f 2)
num=$(echo $TITLE | grep -aie '^TRACKNUMBER' | cut -d '=' -f 2 | cut -d '/' -f 1)
title=$(echo $TITLE | grep -aie '^TITLE' | cut -d '=' -f 2)
;;
*.flac|*.FLAC|*.Flac)
fmt=flac
TITLE=$(metaflac $i --export-tags-to=-)
artist=$(echo $TITLE | grep -aie '^ARTIST' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -aie '^ALBUM' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -aie '^DATE' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -aie '^GENRE' | cut -d '=' -f 2)
num=$(echo $TITLE | grep -aie '^TRACKNUMBER' | cut -d '=' -f 2 | cut -d '/' -f 1)
title=$(echo $TITLE | grep -aie '^TITLE' | cut -d '=' -f 2)
;;
*)
echo "Unknown file type: $i"
;;
esac
if [[ -n $_template ]]
then
# replace $num with $(printf %.02d $num) and all special symbols with "_"
template=$(echo $_template | sed -e 's/\$num/\$(printf %\.02d \$num)/g' -e 's/\$totnum/\$(printf %\.02d \$totnum)/g')
template=$(eval echo $template | sed "s/[@#$%^&*=\`\'\"\/\|\\ ]/_/g")
else
# template is just $num-$title
template="$(printf %.02d $num)-$(echo $title | sed "s/[@#$%^&*=\`\'\"\/\|\\ ]/_/g")"
fi
mv "$i" "$(dirname $i)/$template.$fmt"
done
exit 0
}
recode() {
for i in $files
do
case $i in
*.mp3|*.MP3|*.Mp3)
mid3iconv -eCP1251 --remove-v1 "$i"
;;
*)
echo "$i is not an mp3 file"
;;
esac
done
exit 0
}
showinfo() {
echo "No.: <Artist> {Album} (Year) [Genre] Title"
echo "----------------------------------------"
for i in $files
do
case $i in
*.mp3|*.MP3|*.Mp3)
TITLE=$(mid3v2 $i)
artist=$(echo $TITLE | grep -ae '^TPE1' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -ae '^TALB' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -ae '^TDRC' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -ae '^TCON' | cut -d '=' -f 2)
num=$(echo $TITLE | grep -ae '^TRCK' | cut -d '=' -f 2)
title=$(echo $TITLE | grep -ae '^TIT2' | cut -d '=' -f 2)
echo "$num: <$artist> {$album} ($year) [$genre] $title"
;;
*.ogg|*.OGG|*.Ogg)
TITLE=$(vorbiscomment -l $i)
artist=$(echo $TITLE | grep -aie '^ARTIST' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -aie '^ALBUM' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -aie '^DATE' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -aie '^GENRE' | cut -d '=' -f 2)
num="$(echo $TITLE | grep -aie '^TRACKNUMBER' | cut -d '=' -f 2)/$(echo $TITLE | grep -aie '^TRACKTOTAL' | cut -d '=' -f 2)"
title=$(echo $TITLE | grep -aie '^TITLE' | cut -d '=' -f 2)
echo "$num: <$artist> {$album} ($year) [$genre] $title"
;;
*.flac|*.FLAC|*.Flac)
TITLE=$(metaflac $i --export-tags-to=-)
artist=$(echo $TITLE | grep -aie '^ARTIST' | cut -d '=' -f 2)
album=$(echo $TITLE | grep -aie '^ALBUM' | cut -d '=' -f 2)
year=$(echo $TITLE | grep -aie '^DATE' | cut -d '=' -f 2)
genre=$(echo $TITLE | grep -aie '^GENRE' | cut -d '=' -f 2)
num="$(echo $TITLE | grep -aie '^TRACKNUMBER' | cut -d '=' -f 2)/$(echo $TITLE | grep -aie '^TRACKTOTAL' | cut -d '=' -f 2)"
title=$(echo $TITLE | grep -aie '^TITLE' | cut -d '=' -f 2)
echo "$num: <$artist> [$album] ($year) {$genre} $title"
;;
*)
echo "Unknown file type: $i"
;;
esac
done
exit 0
}
[[ $RENAMEONLY -eq 1 ]] && renameonly
[[ $RECODEONLY -eq 1 ]] && recode
[[ $SHOWINFO -eq 1 ]] && showinfo
filltag
exit 0
# vim: set ft=sh:
Компьютер служит для решения тех проблем, которых до изобретения компьютера не существовало
-
Xapdpokep
- Сообщения: 8
- ОС: Xubuntu 9.04
Re: id3 тагер
Посоветую автору Ex Falso, очень удобный интерфейс у программы!
-
SilentOS
- Сообщения: 251
- Статус: Важный воевода
- ОС: SuSE
Re: id3 тагер
И еще KDE-шный Kid3 - тоже ничего )
Для #!/bin/bash должно работать нормально?
Код: Выделить всё
#!/bin/zshДля #!/bin/bash должно работать нормально?
-
Black
- Сообщения: 1104
- ОС: ArchLinux
Re: id3 тагер
На bash не проверял. Скорее всего надо будет кое-чего подправить, т.к. там есть zsh-специфичные вещи. На bash я уже лет 5 как не сидел (как не больше), так что точнее не скажу. Если есть zsh, то лучше пусть на нём и работает. Если нет, то меняйте #!/bin/zsh на #!/bin/bash и проверяйте на забэкапленных файлах.
Компьютер служит для решения тех проблем, которых до изобретения компьютера не существовало
-
vonabarak
- Сообщения: 146
Re: id3 тагер
Хотя скриптов для конвертирования я и не просил, но все равно пасиба. Еще какие-то предложения?
Йа тьомный эльф