X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=xmlrtorrent.pl;h=3514100995909ca0842dbb2681ff676ae91c590c;hb=4e9ffeb12d88dfe9d4c480c0995308a93909653a;hp=7d9e290bc7abc716f461a8d07e97054e54b1b2eb;hpb=04b77099c1d5e26a81651245b5949dee2c8e6bf6;p=xmlrtorrent.git diff --git a/xmlrtorrent.pl b/xmlrtorrent.pl index 7d9e290..3514100 100644 --- a/xmlrtorrent.pl +++ b/xmlrtorrent.pl @@ -26,9 +26,6 @@ my $rtorrent; my @outputstack = (undef); my $PARAMS = { - 'XMLURL' => 'http://localhost/RPC2', - 'USERNAME' => '', - 'PASSWORD' => '', '_QUEUE' => {}, }; @@ -128,7 +125,6 @@ sub check_for_link { my $message = ($parammessage == -1) ? '' : $signal->[$parammessage]; my $nick = ($paramnick == -1)?defined($server)?$server->{'nick'}:'':$signal->[$paramnick]; my $g; - my $m; my $p; my $witem; @@ -137,27 +133,19 @@ sub check_for_link { } else { $witem = Irssi::window_item_find($target); } - + # Look if we should ignore this line if ($message =~ m,(?:\s|^)/nosave(?:\s|$),) { return; } - + push_output($witem); # Look if there is a torrent link in there - $message =~ m,(http://\S*\.(?:torrent|penis)),; - $m = $1; - while (defined($m)) { - write_debug('Torrent-URL: %s', $m); - $torrentlist{$torrentindex++} = {'CHANNEL' => $target, 'NICK' => $nick, 'URL' => $m}; - - # Remove the matched part from the message and try again (there may be - # more!) - $message =~ s/$m//; - - $message =~ m|(http://.*\.torrent)|; - $m = $1; + + while ($message =~ m,(http://\S*\.(?:torrent|penis)),g) { + write_debug('Torrent-URL: %s', $1); + $torrentlist{$torrentindex++} = {'CHANNEL' => $target, 'NICK' => $nick, 'URL' => $1}; } pop_output();