Skip to content

Commit

Permalink
add(comments/qbit-xseed-cat): more comments to describe usage and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkarry committed May 7, 2024
1 parent bb8b498 commit ef1bbf3
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions xseed_qbit_cat_filter.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

# chmod +x the script
# put the following execution command in your qbit with its absolute path.
# /qB_post.sh "%F" "%L" "%N" "%T" "%I"
# chmod +x this script (terminal command e.g. `chmod +x xseed_qbit_cat_filter.sh`)
# put the following execution command in your qbit with its absolute path from qbit's
# perspective (container path if docker).
#
# /path/to/xseed_qbit_cat_filter.sh "%F" "%L" "%N" "%T" "%I"

TORRENT_PATH=$1
TORRENT_CAT=$2
Expand Down Expand Up @@ -48,12 +50,28 @@ fi
log "[\033[1m$TORRENT_NAME\033[0m] [$TORRENT_CAT]"


## setup if logic for the categories you want, copy paste 53 through 55 and duplicate for more logic
# setup "if logic" for the categories you want, copy paste and add `elif` and duplicate for more logic

# searches the categories "Radarr-HD and Radarr-UHD with infohash, and if no match uses data based
if [[ "$TORRENT_CAT" =~ ^(Radarr-HD|Radarr-UHD)$ ]]; then
xseed_resp=$(cross_seed_request "infoHash=$TORRENT_INFOHASH");
[ "$xseed_resp" != "204" ] && sleep 30 && xseed_resp=$(cross_seed_request "path=$TORRENT_PATH")
elif [[ "$TORRENT_CAT" =~ ^(TV|TV-HQ)$ ]]; then

# searches the trackers matching the url "tracker.announce.com" and "tracker.announce2.com" and if no match uses data based
elif [[ "$TORRENT_TRACKER" =~ (tracker.announce.com|tracker.announce2.com) ]]; then
xseed_resp=$(cross_seed_request "infoHash=$TORRENT_INFOHASH");
[ "$xseed_resp" != "204" ] && sleep 30 && xseed_resp=$(cross_seed_request "path=$TORRENT_PATH")
fi

# searches the "DATA-CATEGORY" and "DATA-SEARCH" only with data-based matching
elif [[ "$TORRENT_CAT" =~ ^(DATA-CATEGORY|DATA-SEARCH)$ ]]; then
xseed_resp=$(cross_seed_request "path=$TORRENT_PATH")

# searches the "INFOHASH-ONLY" category by infohash only
elif [[ "$TORRENT_CAT" =~ ^(DATA-CATEGORY|DATA-SEARCH)$ ]]; then
xseed_resp=$(cross_seed_request "infoHash=$TORRENT_INFOHASH");
fi

# if none of the previous conditions are met, the script will do nothing
# use the previous examples to craft the logic of your choosing.
# if you do not wish to do anything with specific categories or trackers, simply
# use the normal methods provided on cross-seed.org or the import script on this repo

0 comments on commit ef1bbf3

Please sign in to comment.