|
@@ -33,7 +33,7 @@ my $TIMEOUT = 15;
|
|
|
my $ERR_DELAY = $TIMEOUT * 2;
|
|
my $ERR_DELAY = $TIMEOUT * 2;
|
|
|
my $ERR_RETRIES = 3;
|
|
my $ERR_RETRIES = 3;
|
|
|
my $UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A';
|
|
my $UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A';
|
|
|
-my $EXCLUDES_FILE = undef();
|
|
|
|
|
|
|
+my $EXCLUDES_FILE = $ENV{'HOME'} . '.findTorrent.exclude';
|
|
|
|
|
|
|
|
# Static tracker list, appended to all magnet URIs
|
|
# Static tracker list, appended to all magnet URIs
|
|
|
my @TRACKERS = ('udp://open.demonii.com:1337/announce', 'udp://tracker.publicbt.com:80/announce', 'udp://tracker.openbittorrent.com:80/announce', 'udp://9.rarbg.com:2710/announce');
|
|
my @TRACKERS = ('udp://open.demonii.com:1337/announce', 'udp://tracker.publicbt.com:80/announce', 'udp://tracker.openbittorrent.com:80/announce', 'udp://9.rarbg.com:2710/announce');
|
|
@@ -81,7 +81,7 @@ if ($ENV{'DEBUG'}) {
|
|
|
$DEBUG = 1;
|
|
$DEBUG = 1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-if ($ENV{'EXCLUDES_FILE'}) {
|
|
|
|
|
|
|
+if (exists($ENV{'EXCLUDES_FILE'})) {
|
|
|
$EXCLUDES_FILE = $ENV{'EXCLUDES_FILE'};
|
|
$EXCLUDES_FILE = $ENV{'EXCLUDES_FILE'};
|
|
|
}
|
|
}
|
|
|
if ($ENV{'NO_QUALITY_CHECKS'}) {
|
|
if ($ENV{'NO_QUALITY_CHECKS'}) {
|
|
@@ -102,7 +102,7 @@ if (defined($ENV{'NEXT_EPISODES'})) {
|
|
|
|
|
|
|
|
# Read the torrent excludes list
|
|
# Read the torrent excludes list
|
|
|
my %EXCLUDES = ();
|
|
my %EXCLUDES = ();
|
|
|
-if ($EXCLUDES_FILE) {
|
|
|
|
|
|
|
+if ($EXCLUDES_FILE && -r $EXCLUDES_FILE) {
|
|
|
my $fh;
|
|
my $fh;
|
|
|
open($fh, '<', $EXCLUDES_FILE)
|
|
open($fh, '<', $EXCLUDES_FILE)
|
|
|
or die('Unable to open excludes file: ' . $EXCLUDES_FILE . ': ' . $! . "\n");
|
|
or die('Unable to open excludes file: ' . $EXCLUDES_FILE . ': ' . $! . "\n");
|
|
@@ -124,6 +124,12 @@ if ($EXCLUDES_FILE) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
close($fh);
|
|
close($fh);
|
|
|
|
|
+} elsif ($DEBUG) {
|
|
|
|
|
+ print STDERR 'No excludes file available';
|
|
|
|
|
+ if ($EXCLUDES_FILE) {
|
|
|
|
|
+ print STDERR ': ' . $EXCLUDES_FILE;
|
|
|
|
|
+ }
|
|
|
|
|
+ print STDERR "\n";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Figure out what we're searching for
|
|
# Figure out what we're searching for
|