| version 1.15, 2005/05/04 01:48:35 |
version 1.21, 2006/05/15 19:47:04 |
|
|
| #!/usr/bin/perl -T |
#!/usr/bin/perl -T |
| #$Id$ |
#$RedRiver: CurrentTorrents.pl,v 1.20 2005/06/01 18:01:46 andrew Exp $ |
| use strict; |
use strict; |
| use warnings; |
use warnings; |
| use diagnostics; |
use diagnostics; |
| |
|
| use Time::Local; |
use Time::Local; |
| |
use Fcntl ':flock'; |
| |
|
| use lib 'lib'; |
use lib 'lib'; |
| use OpenBSDTorrents; |
use OpenBSDTorrents; |
| use BT::OBTMetaInfo; |
use BT::MetaInfo::Cached; |
| |
|
| %ENV = (); |
%ENV = (); |
| |
|
|
|
| next; |
next; |
| } |
} |
| |
|
| |
|
| my $t; |
my $t; |
| eval { $t = BT::OBTMetaInfo->new( $torrent ); }; |
eval { |
| |
$t = BT::MetaInfo::Cached->new( |
| |
$torrent, |
| |
{ |
| |
cache_root => |
| |
$OBT->{DIR_HOME} . '/FileCache' |
| |
} |
| |
); |
| |
}; |
| |
|
| if ($@) { |
if ($@) { |
| warn "Error reading torrent $torrent\n"; |
warn "Error reading torrent $torrent\n"; |
|
|
| next; |
next; |
| } |
} |
| |
|
| my $hash = $t->info_hash_cached($torrent); |
my $hash = $t->info_hash; |
| $hash = unpack("H*", $hash); |
$hash = unpack("H*", $hash); |
| |
|
| |
undef $t; |
| |
|
| $files{torrent}{$name}{$epoch}{info_hash} = $hash; |
$files{torrent}{$name}{$epoch}{info_hash} = $hash; |
| |
|
| undef $t; |
|
| |
|
| if (exists $keep{$name}) { |
if (exists $keep{$name}) { |
| if (exists $keep{$name}{$hash}) { |
if (exists $keep{$name}{$hash}) { |