summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/checkMissing9
-rwxr-xr-xbin/checkMissingLink13
-rwxr-xr-xbin/checkMissingmp39
-rwxr-xr-xbin/ogg-maker16
-rwxr-xr-xbin/ogg2mp315
-rwxr-xr-xbin/yout2mp324
-rwxr-xr-xbin/yout2ogg24
-rwxr-xr-xbin/youtplaylist2
-rw-r--r--shell.nix16
9 files changed, 8 insertions, 120 deletions
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
diff --git a/shell.nix b/shell.nix
index 10b8a84..df6ede9 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,12 +1,12 @@
let
- lib = import <stockholm/lib>;
- pkgs = import <nixpkgs> { overlays = [(import <stockholm/krebs/5pkgs>)]; };
- #pkgs = import (opkgs.fetchFromGitHub {
- # owner = "nixos";
- # repo = "nixpkgs";
- # rev = "579a190cfdb187e8a279962bdb3df51fbd23a08b"; #youtube-dl upgrade
- # sha256 = "0lj9kdp0r0c66sb95yiqxjm4s4cywsyy0dpw1w01rff1acgdr2bh";
- #}) {};
+ opkgs = import <nixpkgs> {};
+ stockholm = opkgs.fetchgit {
+ url = "https://cgit.lassul.us/stockholm";
+ rev = "02f67ee";
+ sha256 = "1ml6aw8ds1sw6bl238v9vc78sjv3iys71184ayirmj2kn6dr33ap";
+ };
+ lib = import "${stockholm}/lib";
+ pkgs = import <nixpkgs> { overlays = [(import "${stockholm}/krebs/5pkgs")]; };
commands.review = let
moveToDir = key: dir: pkgs.writeText "move-with-${key}.lua" ''