3 #==============================================================================
5 # File ID: b4f0f5ce-4564-11ef-bb0e-83850402c3ce
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
19 while test -n "$1"; do
21 -h|
--help) opt_help
=1; shift ;;
22 -q|
--quiet) opt_quiet
=$
(($opt_quiet + 1)); shift ;;
23 -v|
--verbose) opt_verbose
=$
(($opt_verbose + 1)); shift ;;
24 --version) echo $progname $VERSION; exit 0 ;;
27 if printf '%s\n' "$1" |
grep -q ^
-; then
28 echo "$progname: $1: Unknown option" >&2
36 opt_verbose
=$
(($opt_verbose - $opt_quiet))
40 if test "$opt_help" = "1"; then
41 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
44 Move files downloaded by yt-dlp and youtube-dl to Kron/YYYY/MM/DD/.
46 Usage: $progname [options]
53 Be more quiet. Can be repeated to increase silence.
55 Increase level of verbosity. Can be repeated.
57 Print version information.
63 topdir
="$($GIT rev-parse --show-toplevel)"
64 tmpfile
=".$progname.tmp"
65 ls -1N *.json |
sort >"$tmpfile"
68 cmd
="$cmd'unset y m d;"
69 cmd
="$cmd y=%s; m=%s; d=%s;"
70 cmd
="$cmd if [ -n \"\$y\" -a -n \"\$m\" -a -n \"\$d\" ]; then"
71 cmd
="$cmd mkdir -p \"$topdir/Kron/\$y/\$m/\$d\";"
74 cmd
="$cmd \"$topdir/Kron/\$y/\$m/\$d/\";"
76 cmd
="$cmd substr(upload_date, 1, 4),"
77 cmd
="$cmd substr(upload_date, 6, 2),"
78 cmd
="$cmd substr(upload_date, 9, 2),"
83 list-youtube
-F "$tmpfile" -S "$cmd" | sh
86 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :