brainerazer |
|
Темы:
0
Сообщения:
1
Участник с: 23 июля 2009
|
Юзаю скрипт, найденный на просторах ЛинуксФорума:#!/bin/bash #By DsTr wink.gif #`kdialog --passivepopup "Ðобавление в коллекÑиÑ..." 1` if [ "$1" == '' ]; then shellDir="$PWD" else shellDir="$1" fi cd "$shellDir" find |while read dir; do if [ -f "$dir" ]; then dirName="`dirname "$dir"`" cd "`dirname "$dir"`" tsFile=`echo "$dir" | sed -ne 's!^.*\/!!p'` ext=`echo "$dir" | sed -ne 's!^.*\.!!p' | tr '[:upper:]' '[:lower:]'` &> /dev/null base=`echo "$tsFile" | sed -e 's!\.[^.]*$!!'` &> /dev/null if [ "$ext" = "ape" ]; then #`kdialog --passivepopup "$dir converting to $base.flac..." 2` mac "$tsFile" "$base.wav" -d flac "$base.wav" rm -f "$tsFile" "$base.wav" fi if [ "$ext" = "wv" ]; then #`kdialog --passivepopup "$dir converting to $base.flac..." 2` wvunpack "$tsFile" flac "$base.wav" rm -f "$tsFile" "$base.wav" fi if [ "$ext" = "bin" ]; then #`kdialog --passivepopup "Converting $dir to $base.flac... " 2` `flac --force-raw-format --channels=2 --sample-rate=44100 --bps=16 --sign=signed --endian=little "$tsFile"` fi if [ "$ext" = "wav" ]; then #`kdialog --passivepopup "Converting $dir to $base.flac... " 2` `flac --force-raw-format --channels=2 --sample-rate=44100 --bps=16 --sign=signed --endian=little "$tsFile"` fi cd "$shellDir" fi done find |while read dir; do if [ -f "$dir" ]; then cd "`dirname "$dir"`" tsFile=`echo "$dir" | sed -ne 's!^.*\/!!p'` ext=`echo "$dir" | sed -ne 's!^.*\.!!p' | tr '[:upper:]' '[:lower:]'` &> /dev/null base=`echo "$dir" | sed -e 's!\.[^.]*$!!'` &> /dev/null if [ "$ext" = "cue" ]; then #`kdialog --passivepopup "Recoding $dir tags to unicode... " 2` pathtoflac=`ls | grep .flac` mv "$pathtoflac" "tmp.flac" mv "$tsFile" "tmp.cue" shnsplit -o wav "tmp.flac" -f "tmp.cue" -t '%n-%t' numTracks=`cueprint "tmp.cue" --disc-template %N` while (( numTracks > 0 )) do perfomer=`cueprint "tmp.cue" -n "$numTracks" --track-template %p` title=`cueprint "tmp.cue" -n "$numTracks" --track-template %t` album=`cueprint "tmp.cue" --disc-template %T` if (( ${#numTracks} == 2 )); then flac --replay-gain --force-raw-format --channels=2 --sample-rate=44100 --bps=16 --sign=signed --endian=little --best "$numTracks-$title.wav" splitname="$numTracks-$title.flac" rm -f "$numTracks-$title.wav" else flac --replay-gain --force-raw-format --channels=2 --sample-rate=44100 --bps=16 --sign=signed --endian=little --best "0$numTracks-$title.wav" splitname="0$numTracks-$title.flac" rm -f "0$numTracks-$title.wav" fi cueprint -n $numTracks -t 'ARRANGER=%A\nCOMPOSER=%C\nGENRE=%G\nMESSAGE=%M\nTRACKNUMBER=%n\nARTIST=%p\nTITLE=%t\nALBUM=%T\n' "tmp.cue" | egrep -v '=$' | metaflac "$splitname" --import-tags-from=- let "numTracks-=1" done rm -f "tmp.cue" "tmp.flac" fi cd "$shellDir" fi done #`kdialog --passivepopup "ÐавеÑÑено..." 1` |