3 #==============================================================================
5 # File ID: cc9e58bc-9e74-11e8-ae29-db5caa6d21d3
7 # Wrapper around the yd* youtube-dl / yt-dlp scripts, checks that the video
8 # hasn't been downloaded before.
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 / yt-dlp scripts, checks that the
35 video hasn't been downloaded before. Works with links understood by the
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
75 && (find *; cat "$dellog" $repo/transp
/1/hent.sh
)) \
76 |
grep --color=always
-- $gr ||
($ydprog -- $
(ydid
-c "$orig_gr") &)
77 if ls |
grep -q -- -$gr\\.temp
\\.
; then
78 echo -n "$T_RED$T_BOLD"
84 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :