Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > NapShare (Cross-platform)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

NapShare (Cross-platform) Download Napshare or Neonapster (GnucDNA 1.1.1.6) now
A fully automated MUTE Network P2P client made to run 24/7 unattended. Take a nap while it does the work! Supply a list of keywords and it will download overnight, also sharing whatever it gets. Runs natively on Linux, will also run on Windows. Napshare mute p2p file share peer anonymous.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 14th, 2002
Unregistered
Guest
 
Posts: n/a
Default perl script for automation (source)

#!/usr/bin/perl

# Author: Bodo Eggert <7eggert@gmx.de>
# Status: pre-alpha
# License: GPL
# ObExcuse: This is my first perl script

#
# To use the script, make a subdirectory and save (or symlink)
# it there. This will be the script data directory.
# Adjust the path to your napshare temporary directory,
# any file not blacklisted and existing in that directory will be
# downloaded.
#
# While used as a filter, the filenames are normalized, matched
# against some filters and, depending on the result, written to
# 1.txt (new), 2.txt or 3.txt (different blocklists) as long as
# they are neither in f_getlist or f_blocklist.
#
# to download, move a line from 1.txt to f_getlist.
# to never display a line again, move it to f_blocklist.
# (if the filter is still active, rename the .txt-file first).
#

($cwd=$0)=~s/\/[^\/]*$//;
chdir $cwd;

#begin program variables
$GETLIST="f_getlist";
$BLOCKLIST="f_blocklist";
$NAPDIR="/d/napshare/"; #don't omit the slash!
#end program variables
#begin system variables
$FGREP="/usr/bin/fgrep";
#end system variables

$blocklist_f = "remix|.(wma|asf)\$|\\bentire album\\b";
$block_f="^t - [0-9]{7}|\^read ?me";
$blocklist_a = "\\b(Backstreet Boys|Janet Jackson|Missy Elliott)\\b";

$genres="\\&|[6-9]0s( music)?|alternative|copy (\([0-9]+\) )?of|new wave|oldies

$mode=' ';
$instring = $ARGV[0];
if(($instring=~s/^-(.)$/$1/)==1){
$mode=$instring;
$instring = $ARGV[1];
}

($ofilename, $size, $speed, $status, $tag) = split(/\//,$instring,5);

check: while(1) {
if($ofilename =~ /$block_f/i) {
$status=3;
last check;
}
($filename=$ofilename) =~ s/_|%20|\~/ /g;
$filename =~ s/\'| $//g;
$filename =~ s/-/ - /g;
$filename =~ s/ +/ /g;
$filename =~ s/(- )+/- /g;
do { $filename =~ s/^ -? ?//g;
} until(($filename =~ s/^($genres|\(($genres)\)|\[$genres\]|\{$genres\}
$filename =~ s/^ -? ?//g;
if(($filename =~ s/^\(([A-Za-z0-9, ]*)\)/$1 - /)
|| ($filename =~ s/^\(([A-Za-z0-9, ]*)\)/$1 - /)){
$filename =~ s/ +/ /g;
$filename =~ s/(- )+/- /g;
$filename =~ s/^ -? ?//g;
}

if(!system $FGREP, '-qsxi', '--', $filename, $GETLIST) {
$status=0;
} elsif(!system $FGREP, '-qsxi', '--', $filename, $BLOCKLIST){
$status=18;
} else {
$status=1;
##################################
if ($filename =~ /\.mp3$/i) {
($f=$filename) =~ s/(\.mp3)*$//i;
if ($f=~ /$blocklist_f/i) {
$status=2;
last check;
} elsif(-e $NAPDIR.$filename) {
$status=0;
last check;
}
@test = split(/ - /, $f, -1);
for($i=0;$i<@test;$i++){
if($test[$i] eq ""){splice(@test,$i,1);}
}
if(@test==1) {
@test = split(/[\(\)]/, $f, -1);
for($i=0;$i<@test;$i++){
if($test[$i] eq ""){splice(@test,$i,1);}
} }
if ($test[0] =~ /$blocklist_a/i) {
$status=2;
last check;
}

print @test.'#' .join(':', @test) . "\n";

# $status=0;
last check;
##################################
}
last check;
}
last check;
}

if($status == 0) { exit 0;}
if($status<16){
$LogFile = $status.".txt";
((-e $LogFile)? open(LOG,">>$LogFile"):open(LOG,">$LogFile"))
|| die("Can't open $LogFile: $!\n");
print LOG $filename."\n";
} else { print $status-16 .$filename."\n"; }

exit $status!=0;
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
quick and dirty perl peerguardian to phex IP block list converter blahblahblabh Development Open Discussion 1 August 29th, 2006 01:48 AM
Shutdown Automation LimeMAN New Feature Requests 0 March 7th, 2006 05:01 AM
How to handle AUTOMATION in Napshare 1.1? Unregistered NapShare (Cross-platform) 5 August 1st, 2002 06:54 PM
Automation Suggestion & Offer Unregistered NapShare (Cross-platform) 2 March 10th, 2002 06:51 PM
Filter on bitrate with automation? Unregistered NapShare (Cross-platform) 0 February 1st, 2002 12:54 AM


All times are GMT -7. The time now is 09:58 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.