Zachary Kotlarek 9 лет назад
Родитель
Сommit
721d22421b
2 измененных файлов с 7 добавлено и 3 удалено
  1. 2 1
      download.sh
  2. 5 2
      findTorrent.pl

+ 2 - 1
download.sh

@@ -55,8 +55,9 @@ elif [ -n "${NZB_URL}" ] && echo "${URLS}" | head -n 1 | grep -Eqi 'nzb.cat/getn
 		for i in ${URLS}; do
 			if [ $SLEEP -gt 0 ]; then sleep $SLEEP; fi
 			SLEEP="${DELAY}"
+			NAME="`echo "${i}" | cut -d '#' -f 2-`"
 			RESULT="`curl --silent --max-time "${TIMEOUT}" "${NZB_URL}" \
-				-d '{"method":"append","params":["download.sh.nzb","'"${i}"'","",0,false,false,"",0,"force"]}'`"
+				-d '{"method":"append","params":["'"${NAME}"'.nzb","'"${i}"'","",0,false,false,"",0,"force"]}'`"
 			if ! echo "${RESULT}" | grep 'result' | grep -q '[1-9]'; then
 				exit 1
 			fi

+ 5 - 2
findTorrent.pl

@@ -18,7 +18,7 @@ my $EXCLUDES_FILE = $ENV{'HOME'} . '/.findTorrent.exclude';
 
 # Search parameters
 my $PROTOCOL = 'https';
-my %ENABLE_SOURCE = ('NCAT' => 0, 'TPB' => 1, 'ISO' => 0, 'KICK' => 0, 'Z' => 0, 'ET' => 1);
+my %ENABLE_SOURCE = ('NCAT' => 1, 'TPB' => 0, 'ISO' => 0, 'KICK' => 0, 'Z' => 0, 'ET' => 0);
 
 # Selection parameters
 my $MIN_COUNT        = 10;
@@ -1063,7 +1063,7 @@ foreach my $content (@json_content) {
 	if (exists($content->{'title'}) && $content->{'title'} =~ /NZBCat/i) {
 		my $list = $content->{'item'};
 		if (!$list || ref($list) ne 'ARRAY') {
-			warn('Invalid NCAT list: ' . $list . "\n");
+			warn("Invalid NCAT list\n");
 			next;
 		}
 
@@ -1097,6 +1097,9 @@ foreach my $content (@json_content) {
 			} elsif (exists($item->{'description'}) && $item->{'description'}) {
 				$title = $item->{'description'};
 			}
+			if ($title) {
+				$url .= '#' . $title;
+			}
 
 			# Extract the season and episode numbers
 			my ($season, $episode) = findSE($title);