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 #==============================================================================
22 dellog
=/tmp
/musikk-del.log
23 delloglock
="$dellog.lock"
24 repo
=/home
/annex
/musikk
26 if test "$1" = "--version"; then
27 echo $progname $VERSION
31 if test "$1" = "-h" -o "$1" = "--help"; then
34 Wrapper around the yd* youtube-dl scripts, checks that the video hasn't
35 been downloaded before. Works with links understood by the ydid(1)
38 Usage: $progname [options] YDPROG
45 Print version information.
52 if [ -z "$ydprog" ]; then
53 echo $progname: Missing ydprog argument
>&2
57 until mkdir
"$delloglock" 2>/dev
/null
; do
58 echo $progname: $delloglock: Waiting
for lockdir
>&2
63 git log
--name-status --format= |
grep ^D
>"$dellog" || true
66 rmdir "$delloglock" ||
exit 1
69 read -p "$ydprog URL: " orig_gr
70 test -z "$orig_gr" && continue
72 test -z "$gr" && continue
74 (cd "$repo" && (find *; cat "$dellog")) |
grep -- $gr ||
75 ($ydprog -- $
(ydid
-c "$orig_gr") &)
76 if ls |
grep -q -- -$gr\\.temp
\\.
; then
77 echo -n "$T_RED$T_BOLD"
83 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :