Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Kazaa Lite Companion

by Dragonfly (Priest)
on Jul 18, 2002 at 04:13 UTC ( #182703=CUFP: print w/ replies, xml ) Need Help??

I use this tiny script in conjunction with Kazaa Lite, a P2P file-sharing application. The script checks the Kazaa shared folder continually for incoming (finished) files, and then moves them into a different location. Once they are moved into an unshared folder, other people can no longer download them from the system Kazaa Lite is running upon. This limits upstream bandwidth consumption, which is a nice side effect if throughput is important to you (or you would like to not attract attention from your ISP, which may or may not be banning servers in their TOS.)

I wrote this script in response to the MPAA's decision to start finding people sharing files, and hassling their ISP to try to get their service disconnected. I know that many people here probably don't agree with file sharing in general, or perhaps some may think it is rather dispicable to not share files in return with the other members of the file-sharing communities, but I personally only use Kazaa Lite occasionally to download MP3s or VHS captures of movies I already own (which is arguably legal under the Fair Use Act), and I feel no obligation to continue sharing the files with the rest of the world after I have them.

So, I just let this run in the background while I am running Kazaa Lite. I'd like to extend it at some point to sort files by type, or maybe even try and get clever and have it guess whether it's a Los Lobos song and create a directory for it or whatnot. Probably not, though. I've been a busy boy lately.

# c:\perl\lib\MyService.pl use strict; use warnings; use File::Copy; my $dir = "C:\\Program Files\\Kazaa Lite\\My Shared Folder"; my $dest = "C:\\incoming"; while (1) { opendir(DIR,$dir) || die "can't opendir $dir: $!"; while(my $file = readdir(DIR)) { if ($file=~/\.dat$/i) { my $i = '1'; } else { move ("$dir\\$file", "$dest\\$file"); } } sleep(3); closedir DIR; }

P.S. This is running on a Windows 98 computer, but it can be converted to run as a service under NT/2000 by following this handy guide. I know it's not that hard of a script to write, but maybe someone else out there can use it.

Comment on Kazaa Lite Companion
Download Code
Re: Kazaa Lite Companion
by mjeaton (Hermit) on Jul 18, 2002 at 12:44 UTC
    I know it would be as cool as using Perl, but couldn't you just disable file sharing in Kazaa Lite?

    Under Options | Traffic, there is an option to disable all sharing.

    I do like the idea of automatically moving the files to a different location though.

    mike
      That is true, but I didn't do it that way for two reasons: one, because I've seen the user options get mysteriously "reset", once or twice while I've been using the program (I am not quite sure how this was accomplished, but it's happened to me a few times now) and I've wound up sharing again for whatever reason.

      And two, because if you block sharing, other users sometimes get angry with you; I think that this way, it just shows you sharing, but without anything in your shared folder yet. I don't know if either of these reasons make a difference, actually, but I wrote this up real quick anyhow, and I'm going to try to extend it this weekend.

        That's true. I turned off sharing and I've found that I have a lot of difficulties downloading files -- maybe I'll turn sharing on, use your script and see if my luck changes.

        mike
Re: Kazaa Lite Companion
by Sifmole (Chaplain) on Jul 19, 2002 at 11:50 UTC
    #1-12 Why would you install this Trojan horse of a program on your system in the first place?

    #13 So basically this is for people who want to leech off of the community and return nothing? If the entire community uses this, then who or what will be shared?

      Trojan horse? Perhaps you are thinking of Kazaa, not Kazaa Lite.

      And yes, I thought I clearly stated in my first two posts that I want to download (or leech, as you disparagingly refer to it) some files from "the community" under the Fair Use Act (because I already own a copy, or "license", of the materials in question) without running a server, which would be a clear violation of my ISP's Terms of Service agreement.

      And thank you for the compliment, but frankly, there is a very slim chance that my script will be used by everyone (or even a select few, for that matter) in the "community". I highly doubt the ~2.0 million logged in users of Kazaa particularly care that my node doesn't have "spiderman~~_DiVX_rip_.avi - SHARE OR YOUR DOWNLOAD WILL BE CANCELED!!!" available. The nice thing about peer to peer software is that there is always someone out there ignorant or careless enough to break the law; that doesn't mean I have to do it.

      In regards to "giving back to the community", I feel no obligation to operate a server for the benefit of other users on a public network, even if I'm using said public network. Why should I? Most of the users of Kazaa and Morpheus don't show any respect to our programmer brethren; they sit online 24/7 gorging themselves on copyrighted programs, music, and movies, without even considering the fact that they are taking the fruits of years of creativity and engineering with no regard for the livelihood of the creators. Why should I facilitate their efforts to rip other people off? If you're trying to take the moral high ground here, I think you might want to reconsider your argument.

      I know some people have expressed discontentment already with their votes on this node, which is why I was a little reluctant to post it in the first place, but give me a break; not everyone who uses P2P software is breaking the law, and not everyone wants to give their ISP a reason to shut off their service without notice.

      edit: corrected a typo after submitting.

Re: Kazaa Lite Companion
by treefr0g (Novice) on Jul 20, 2002 at 18:33 UTC
    Just out of curiosity, what is the line

    my $i = '1';

    for in your if block? Seems like you could just use an unless block instead of if/else.

    I do really like the idea of using this to sort files by type and/or artist.
      D'oh! I always forget about unless. You're absolutely right, it's sheer force of bad habit on my part. Still, I might use if/elseif/else to do more sophisticated sorting. I'm not sure yet...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://182703]
Approved by sm3g
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (16)
As of 2014-08-22 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (161 votes), past polls