From 608857af5ba9c7f4a421bf3ec6ad3cdd1ff707b2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 11 Mar 2018 18:57:49 +0100 Subject: shell.nix: run on all nix systems --- bin/checkMissing | 9 --------- bin/checkMissingLink | 13 ------------- bin/checkMissingmp3 | 9 --------- bin/ogg-maker | 16 ---------------- bin/ogg2mp3 | 15 --------------- bin/yout2mp3 | 24 ------------------------ bin/yout2ogg | 24 ------------------------ bin/youtplaylist | 2 -- 8 files changed, 112 deletions(-) delete mode 100755 bin/checkMissing delete mode 100755 bin/checkMissingLink delete mode 100755 bin/checkMissingmp3 delete mode 100755 bin/ogg-maker delete mode 100755 bin/ogg2mp3 delete mode 100755 bin/yout2mp3 delete mode 100755 bin/yout2ogg delete mode 100755 bin/youtplaylist (limited to 'bin') diff --git a/bin/checkMissing b/bin/checkMissing deleted file mode 100755 index f53549c..0000000 --- a/bin/checkMissing +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -uri=$1 -musicDir=${musicDir-./} -id=$(echo "$uri" | sed -n 's@^https\?://www\.youtube\.com/watch?v=@@p' | sed 's/#.*$//') - -if ! file=$(find $musicDir -maxdepth 1 | grep -q "[-]$id\\.ogg\$"); then - echo $uri -fi diff --git a/bin/checkMissingLink b/bin/checkMissingLink deleted file mode 100755 index 4b53f79..0000000 --- a/bin/checkMissingLink +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -file=$1 -id=$(echo "$file" | sed 's/.*\(.\{11\}\)\.ogg/\1/') - -if [ $id = '' ]; then - echo 'no id' - exit 23 -fi - -if ! grep -q -- "$id#" links; then - echo $file -fi diff --git a/bin/checkMissingmp3 b/bin/checkMissingmp3 deleted file mode 100755 index d7722d2..0000000 --- a/bin/checkMissingmp3 +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -uri=$1 -musicDir=${musicDir-./} -id=$(echo "$uri" | sed -n 's@^https\?://www\.youtube\.com/watch?v=@@p' | sed 's/#.*$//') - -if ! file=$(find $musicDir | grep -q "[-]$id\\.mp3\$"); then - echo $uri -fi diff --git a/bin/ogg-maker b/bin/ogg-maker deleted file mode 100755 index a812f09..0000000 --- a/bin/ogg-maker +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -filename="$1" -outname=$(echo $1 | sed 's/^\(.*\)\..*/\1/').ogg -if [ "$filename" == "$outname" ]; then - ffmpeg -i $filename tmp_$outname - sox --norm tmp_$outname tmp2_$outname silence 1 0.1 1% reverse silence 1 0.1 1% reverse rate 44100 - rm tmp_$outname - vorbisgain tmp2_$outname - mv tmp2_$outname $outname -else - ffmpeg -i $filename tmp_$outname - sox --norm tmp_$outname $outname silence 1 0.1 1% reverse silence 1 0.1 1% reverse rate 44100 - rm tmp_$outname - vorbisgain $outname - rm $filename -fi diff --git a/bin/ogg2mp3 b/bin/ogg2mp3 deleted file mode 100755 index 1fbf414..0000000 --- a/bin/ogg2mp3 +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/sh -set -euf -target_folder=${target-./} - -source=$1 -target_mp3=$(basename $1 | sed 's/ogg$/mp3/') - -mkdir -p $target_folder - -if test -e $target_folder/$target_mp3; then - echo "already done: $target_mp3 in $target_folder" >&2 - exit -fi - -ffmpeg -i $source $target_folder/$target_mp3 diff --git a/bin/yout2mp3 b/bin/yout2mp3 deleted file mode 100755 index 72ea234..0000000 --- a/bin/yout2mp3 +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh -set -euf -target_folder=${target-./} - -uri=$1 -id=$(echo "$uri" | sed -n 's@^https\?://www\.youtube\.com/watch?v=@@p' | sed 's/#.*$//') -script=$(readlink -f "$0") -basedir=$(dirname $script) - -mkdir -p $target_folder - -if ! echo "$id" | grep -q .; then - echo "bad uri: $uri" >&2 - exit 23 -fi - -cd $target_folder - -if file=$(ls | grep "[-]$id\\.mp3\$"); then - echo "already done: $file in $target_folder" >&2 - exit -fi - -youtube-dl -i -o "%(title)s-%(id)s.%(ext)s" --restrict-filenames -x "$uri" --add-metadata --audio-format mp3 diff --git a/bin/yout2ogg b/bin/yout2ogg deleted file mode 100755 index b316099..0000000 --- a/bin/yout2ogg +++ /dev/null @@ -1,24 +0,0 @@ -#! /bin/sh -set -euf -target_folder=${target-./} - -uri=$1 -id=$(echo "$uri" | sed -n 's@^https\?://www\.youtube\.com/watch?v=@@p' | sed 's/#.*$//') -script=$(readlink -f "$0") -basedir=$(dirname $script) - -mkdir -p $target_folder - -if ! echo "$id" | grep -q .; then - echo "bad uri: $uri" >&2 - exit 23 -fi - -cd $target_folder - -if file=$(ls | grep "[-]$id\\.ogg\$"); then - echo "already done: $file in $target_folder" >&2 - exit -fi - -youtube-dl -i -o "%(title)s-%(id)s.%(ext)s" --restrict-filenames -x "$uri" --add-metadata --exec "$basedir/ogg-maker {}" diff --git a/bin/youtplaylist b/bin/youtplaylist deleted file mode 100755 index c2468a0..0000000 --- a/bin/youtplaylist +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -youtube-dl -i -o "http://www.youtube.com/watch?v=%(id)s#%(title)s" --restrict-filenames --get-filename $1 -- cgit v1.2.3