Updated External programs: savecategory (markdown)

Jef LeCompte 2020-06-07 17:59:14 -04:00
parent 1e0897fadc
commit d4e6637a7b

@ -18,20 +18,18 @@ Save the script below as `savecategory` and make it executable via `chmod 755 /p
category=$(basename $1) category=$(basename $1)
torrent_hash=$2 torrent_hash=$2
torrent_name=$3 torrent_name=$3
apiv2=http://localhost:8112/api/v2 apiv2=http://localhost:25832/api/v2
username=admin username=admin
password=adminadmin password=adminadmin
cookie_file=/config/external/cookie cookie_file=/config/external/cookie
echo "running savecategory script" echo "running savecategory script"
if [ ! -f "$cookie_file" ]; then echo "getting cookie"
echo "getting cookie"
curl --silent --fail --show-error --request GET \ curl --silent --fail --show-error --request GET \
--url "$apiv2/auth/login?username=$username&password=$password" \ --url "$apiv2/auth/login?username=$username&password=$password" \
--cookie-jar "$cookie_file" > /dev/null --cookie-jar "$cookie_file" > /dev/null
fi
echo "setting $torrent_name to category $category" echo "setting $torrent_name to category $category"