|
@@ -554,7 +554,6 @@ foreach my $content (@html_content) {
|
|
|
|
|
|
|
|
# Find TR elements from TPB
|
|
# Find TR elements from TPB
|
|
|
my @trs = splitTRs($content);
|
|
my @trs = splitTRs($content);
|
|
|
- undef($content);
|
|
|
|
|
foreach my $tr (@trs) {
|
|
foreach my $tr (@trs) {
|
|
|
|
|
|
|
|
# Find the show title
|
|
# Find the show title
|
|
@@ -624,7 +623,6 @@ foreach my $content (@html_content) {
|
|
|
|
|
|
|
|
# Find each TR element from ISOHunt
|
|
# Find each TR element from ISOHunt
|
|
|
my @trs = splitTRs($content);
|
|
my @trs = splitTRs($content);
|
|
|
- undef($content);
|
|
|
|
|
foreach my $tr (@trs) {
|
|
foreach my $tr (@trs) {
|
|
|
|
|
|
|
|
# Split each TD element from the row
|
|
# Split each TD element from the row
|
|
@@ -635,8 +633,8 @@ foreach my $content (@html_content) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Skip sponsored results
|
|
# Skip sponsored results
|
|
|
- if ($tds[2] =~ /Sponsored\<\/td\>/i) {
|
|
|
|
|
- if ($DEBUG) {
|
|
|
|
|
|
|
+ if ($tds[1] =~ /Sponsored\<\/td\>/i) {
|
|
|
|
|
+ if ($DEBUG > 1) {
|
|
|
print STDERR "Skipping sponsored result\n";
|
|
print STDERR "Skipping sponsored result\n";
|
|
|
}
|
|
}
|
|
|
next;
|
|
next;
|
|
@@ -646,7 +644,7 @@ foreach my $content (@html_content) {
|
|
|
my ($id, $title) = $tds[2] =~ /\<a(?:\s+[^\>]*)?href=\"\/torrent_details\/(\d+)\/[^\"]*\"\>\<span\>([^\>]+)\<\/span\>/i;
|
|
my ($id, $title) = $tds[2] =~ /\<a(?:\s+[^\>]*)?href=\"\/torrent_details\/(\d+)\/[^\"]*\"\>\<span\>([^\>]+)\<\/span\>/i;
|
|
|
if (!defined($id) || length($id) < 1 || !defined($title) || length($title) < 1) {
|
|
if (!defined($id) || length($id) < 1 || !defined($title) || length($title) < 1) {
|
|
|
if ($DEBUG) {
|
|
if ($DEBUG) {
|
|
|
- print STDERR "Unable to find show ID or title in TD:\n\t" . $tds[1] . "\n";
|
|
|
|
|
|
|
+ print STDERR "Unable to find show ID or title in TD:\n\t" . $tds[2] . "\n";
|
|
|
}
|
|
}
|
|
|
next;
|
|
next;
|
|
|
}
|
|
}
|
|
@@ -928,11 +926,9 @@ exit(0);
|
|
|
sub splitTRs($) {
|
|
sub splitTRs($) {
|
|
|
my ($content) = @_;
|
|
my ($content) = @_;
|
|
|
|
|
|
|
|
- # Find each TR element from ISOHunt
|
|
|
|
|
|
|
+ # Find each TR element
|
|
|
my @trs = ();
|
|
my @trs = ();
|
|
|
my @rawTRs = split(/\<tr(?:\s+[^\>]*)?\>/i, $content);
|
|
my @rawTRs = split(/\<tr(?:\s+[^\>]*)?\>/i, $content);
|
|
|
- undef($content);
|
|
|
|
|
-
|
|
|
|
|
foreach my $tr (@rawTRs) {
|
|
foreach my $tr (@rawTRs) {
|
|
|
|
|
|
|
|
# Trim trailing tags and skip things that aren't complete TRs
|
|
# Trim trailing tags and skip things that aren't complete TRs
|