sane-bt-add: add help message & port to nix-shell
This commit is contained in:
parent
d6fb2ab5b4
commit
c662936490
|
@ -108,17 +108,22 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
py-scripts = {
|
py-scripts = {
|
||||||
# anything added to this attrset gets symlink-joined into into `sane-scripts`
|
# anything added to this attrset gets symlink-joined into `sane-scripts`
|
||||||
bt-search = static-nix-shell.mkPython3Bin {
|
bt-add = static-nix-shell.mkBash {
|
||||||
pname = "sane-bt-search";
|
pname = "sane-bt-add";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pyPkgs = [ "natsort" "requests" ];
|
pkgs = [ "transmission" ];
|
||||||
};
|
};
|
||||||
bt-rm = static-nix-shell.mkBash {
|
bt-rm = static-nix-shell.mkBash {
|
||||||
pname = "sane-bt-rm";
|
pname = "sane-bt-rm";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
pkgs = [ "transmission" ];
|
pkgs = [ "transmission" ];
|
||||||
};
|
};
|
||||||
|
bt-search = static-nix-shell.mkPython3Bin {
|
||||||
|
pname = "sane-bt-search";
|
||||||
|
src = ./src;
|
||||||
|
pyPkgs = [ "natsort" "requests" ];
|
||||||
|
};
|
||||||
date-math = static-nix-shell.mkPython3Bin {
|
date-math = static-nix-shell.mkPython3Bin {
|
||||||
pname = "sane-date-math";
|
pname = "sane-date-math";
|
||||||
src = ./src;
|
src = ./src;
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash -p transmission
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
endpoint=https://bt.uninsane.org/transmission/rpc
|
endpoint=https://bt.uninsane.org/transmission/rpc
|
||||||
PASS=$(sudo cat /run/secrets/transmission_passwd)
|
PASS=$(sudo cat /run/secrets/transmission_passwd)
|
||||||
|
|
||||||
options=$(getopt -l prefix:,film,show:,book:,audiobook:,vn:,author: -- "" "${@}")
|
options=$(getopt -l help,prefix:,film,show:,book:,audiobook:,vn:,author: -- "" "${@}")
|
||||||
eval "set -- ${options}"
|
eval "set -- ${options}"
|
||||||
|
|
||||||
type=
|
type=
|
||||||
|
@ -14,6 +15,22 @@ author=
|
||||||
prefix=
|
prefix=
|
||||||
while true; do
|
while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
(--help)
|
||||||
|
echo "add a .torrent or magnet:// file to be downloaded by and stored on my server"
|
||||||
|
echo "usage: sane-bt-add [options] <magnet:// URI or path/to.torrent>"
|
||||||
|
echo "options:"
|
||||||
|
echo " --prefix <PathString>"
|
||||||
|
echo " --film"
|
||||||
|
echo " --show <ShowTitle>"
|
||||||
|
echo " --book <BookTitle>"
|
||||||
|
echo " --audiobook <BookTitle>"
|
||||||
|
echo " --vn <VisualNovelTitle>"
|
||||||
|
echo " --author <Author>"
|
||||||
|
echo ""
|
||||||
|
echo "the above options are used to construct the filesystem path where the torrent data will live"
|
||||||
|
echo "everything is relative to the root media directory (not /)"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
(--prefix)
|
(--prefix)
|
||||||
shift
|
shift
|
||||||
prefix="$1"
|
prefix="$1"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user