瀏覽代碼

Support coversion of current file

master
Arun Prakash Jana 4 年之前
父節點
當前提交
78372b203a
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A75979F35C080412
共有 1 個文件被更改,包括 16 次插入9 次删除
  1. +16
    -9
      plugins/mp3conv

+ 16
- 9
plugins/mp3conv 查看文件

@@ -9,10 +9,6 @@

outdir=_mp3files

if ! [ -e "${outdir}" ]; then
mkdir "${outdir}"
fi

handle_multimedia() {
mime="${1}"
file="${2}"
@@ -26,9 +22,20 @@ handle_multimedia() {
esac
}

for f in *; do
if [ -f "${f}" ]; then
mimestr="$( file --dereference --brief --mime-type -- "${f}" )"
handle_multimedia "${mimestr}" "${f}"
printf "Process 'a'll in directory or 'c'urrent? "
read -r resp

if [ "$resp" = "a" ]; then
if ! [ -e "${outdir}" ]; then
mkdir "${outdir}"
fi
done

for f in *; do
if [ -f "${f}" ]; then
mimestr="$( file --dereference --brief --mime-type -- "${f}" )"
handle_multimedia "${mimestr}" "${f}"
fi
done
elif [ "$resp" = "c" ] && [ -f "$1" ]; then
ffmpeg -i "${1}" -vn -codec:a libmp3lame -q:a 2 "${1%.*}.mp3"
fi

Loading…
取消
儲存