Thursday, October 25, 2007

Bittorrent Mainline Port Randomizer / Custom Settings script

Here is a quick and dirty bash script that I used when Bittorrent Mainline removed the random port option.

  • The script uses a random port to listen from a given range
  • Sets custom upload limits,refresh intervals and client address(IP)
  • Disables Linux uPnP
  • Changes the default data directory (default is ~/Desktop/Bittorrent)
  • Saves the downloaded file to current directory

Copy the code to text file and save it as Bitty.sh and set execute permission with 'chmod a+x Bitty.sh' and launch with ./Bitty.sh <torrentfile>.torrent

You may need to change the values to suit your needs. Also note that the You the /usr/bin/bittorrent-console is commandline client from the bittorrent Mainline for GNU/Linux and change the location on your Linux distro.


#!/bin/sh
#
#
#set -n
# Bitty.sh - a port randomizer for bittorrent mainline
#set -x 
#
MAXPORT=25000
MINPORT=20000

number=0

while [ "$number" -le $MINPORT ]

do 
  number=$RANDOM
  let "number %= $MAXPORT" 
done 


exec /usr/bin/bittorrent-console  --ip debbox.no-ip.org  --display_interval 30 
--no_upnp --minport $number  --maxport 25000 --max_upload_rate 5120 
--max_initiate 70  --save_incomplete_in /mnt/BigMaMa/.bittorrent/incomplete
 --data_dir /mnt/bigMaMa/.bittorrent  --save_in . "$1"


Please feel free to improve the script !

3 comments:

  1. Thanks for sharing the link, but unfortunately it seems to be down... Does anybody have a mirror or another source? Please answer to my message if you do!

    I would appreciate if someone here at playingwithsid.blogspot.com could repost it.

    Thanks,
    John

    ReplyDelete
  2. @John,

    If you are using Ubuntu install the python-bittorrent package or use other clients like transmission.

    ReplyDelete
  3. i just had an expeirence with utorrent and confirmed it with peer block. if they are reading your port for too long then they can disable internet connection. at least they can on the tether on my cell phone but changing random port about every 30 seconds they wernt able to do it and downloads went fine. it would be nice to have an option to randomize ports every 30 seconds and have time limit change option in thin randomizer.

    ReplyDelete

You can leave a comment here using your Google account, OpenID or as an anonymous user.

Popular Posts