diff options
author | lassulus <lassulus@lassul.us> | 2018-03-11 18:57:49 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2018-03-11 18:57:49 +0100 |
commit | 608857af5ba9c7f4a421bf3ec6ad3cdd1ff707b2 (patch) | |
tree | a26d19678217f09a8f9a2927800f6ab86a8ab75c /bin/yout2mp3 | |
parent | 00b1d065a36a9800a9f8a8f6af30f90a006c9251 (diff) |
shell.nix: run on all nix systems
Diffstat (limited to 'bin/yout2mp3')
-rwxr-xr-x | bin/yout2mp3 | 24 |
1 files changed, 0 insertions, 24 deletions
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 "[31mbad uri: $uri[m" >&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 |