Add 'distro' category to qbth; fix scihub-setup

This commit is contained in:
Jeffrey Serio 2024-07-03 05:04:46 -05:00
parent f1ff90ec48
commit f07a37790e
2 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@ fi
function add_torrents() {
torrents=("$@")
if ! parallel qbt torrent add url ::: "${torrents[@]}"; then
if ! parallel qbt torrent add url --category "distro" ::: "${torrents[@]}"; then
gum log -l error "Error adding torrents"
exit 1
fi
@ -110,6 +110,7 @@ case "$distro_selection" in
;;
"Delete")
# TODO: Fix this. I suspect it has to do with the $relver not expanding in the jq input.
torrent_hashes=$(qbt torrent list -F json | jq '.[] | select(.name | startswith("Fedora") and endswith("$relver")) | .hash' | tr -d '"')
delete_torrents "$torrent_hashes"
;;

View File

@ -114,6 +114,6 @@ qbittorrent-enable:
scihub-setup:
mkdir ~/scihub-torrent-urls
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee scihub-torrent-urls/urls.txt
cd scihub-torrent-urls && split -l 60 urls.txt torrent-
rm -fv scihub-torrent-urls/urls.txt
lynx -dump -nonumbers -listonly=on https://libgen.rs/repository_torrent/ | grep "\.torrent" | tee ~/scihub-torrent-urls/urls.txt
cd ~/scihub-torrent-urls && split -l 60 ~/scihub-torrent-urls/urls.txt torrent-
rm -fv ~/scihub-torrent-urls/urls.txt