@@ -29,7 +29,6 @@ FILTERED_CAT="CAT1|CAT2|CAT3"
2929# Ex) tracker.announce.com|tracker.announce2.com
3030FILTERED_TRACKER=" tracker1.announce.com|tracker2.announce.com"
3131
32-
3332log () {
3433 echo -e " ${0##*/ } : $1 "
3534}
@@ -39,13 +38,13 @@ log_err() {
3938}
4039
4140cross_seed_request () {
42- local data=" $1 "
43- local headers=(-X POST " $XSEED_URL " --data-urlencode " $data " )
44- if [ -n " $XSEED_API_KEY " ]; then
45- headers+=(-H " X-Api-Key: $XSEED_API_KEY " )
46- fi
47- response=$( curl --silent --output /dev/null --write-out " %{http_code}" " ${headers[@]} " )
48- echo " $response "
41+ local data=" $1 "
42+ local headers=(-X POST " $XSEED_URL " --data-urlencode " $data " )
43+ if [ -n " $XSEED_API_KEY " ]; then
44+ headers+=(-H " X-Api-Key: $XSEED_API_KEY " )
45+ fi
46+ response=$( curl --silent --output /dev/null --write-out " %{http_code}" " ${headers[@]} " )
47+ echo " $response "
4948}
5049
5150if [[ -z " $TORRENT_PATH " ]]; then
@@ -56,14 +55,12 @@ elif [[ -z "$TORRENT_CAT" ]]; then
5655 log_err " Category not specified for $TORRENT_PATH "
5756fi
5857
59-
60-
6158if [[ -n " $FILTERED_CAT " ]] && [[ " $TORRENT_CAT " =~ ^($FILTERED_CAT )$ ]]; then
6259 log " [\033[1m$TORRENT_NAME \033[0m] [$TORRENT_CAT ]"
63- xseed_resp=$( cross_seed_request " infoHash=$TORRENT_INFOHASH " ) ;
64- [ " $xseed_resp " != " 204" ] && sleep 30 && xseed_resp=$( cross_seed_request " path=$TORRENT_PATH " )
60+ xseed_resp=$( cross_seed_request " infoHash=$TORRENT_INFOHASH " )
61+ [ " $xseed_resp " != " 204" ] && sleep 30 && xseed_resp=$( cross_seed_request " path=$TORRENT_PATH " )
6562elif [[ -n " $FILTERED_TRACKER " ]] && [[ " $TORRENT_TRACKER " =~ ($FILTERED_TRACKER ) ]]; then
6663 log " [\033[1m$TORRENT_NAME \033[0m] [$TORRENT_TRACKER ]"
67- xseed_resp=$( cross_seed_request " infoHash=$TORRENT_INFOHASH " ) ;
64+ xseed_resp=$( cross_seed_request " infoHash=$TORRENT_INFOHASH " )
6865 [ " $xseed_resp " != " 204" ] && sleep 30 && xseed_resp=$( cross_seed_request " path=$TORRENT_PATH " )
6966fi
0 commit comments