3 #==============================================================================
5 # File ID: cc9e58bc-9e74-11e8-ae29-db5caa6d21d3
7 # Wrapper around the yd* youtube-dl scripts, checks that the video hasn't been
10 # Author: Øyvind A. Holm <sunny@sunbase.org>
11 # License: GNU General Public License version 2 or later.
12 #==============================================================================
18 dellog
=/tmp
/musikk-del.log
19 delloglock
="$dellog.lock"
20 repo
=/home
/annex
/musikk
22 if test "$1" = "--version"; then
23 echo $progname $VERSION
27 if test "$1" = "-h" -o "$1" = "--help"; then
30 Wrapper around the yd* youtube-dl scripts, checks that the video hasn't
31 been downloaded before. Works only with standard Youtube links atm.
33 Usage: $progname [options] YDPROG YOUTUBE_URL
40 Print version information.
47 if [ -z "$ydprog" ]; then
48 echo $progname: Missing ydprog argument
>&2
52 until mkdir
"$delloglock" 2>/dev
/null
; do
53 echo $progname: $delloglock: Waiting
for lockdir
>&2
58 git log
--name-status --format= |
grep ^D
>"$dellog" || true
61 rmdir "$delloglock" ||
exit 1
64 read -p "URL: " orig_gr
65 test -z "$orig_gr" && continue
67 test -z "$gr" && continue
69 (cd "$repo" && (find *; cat "$dellog")) |
grep -- $gr ||
70 ($ydprog -- $
(ydid
-c "$orig_gr") &)
73 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :