Welcome to MuleHashDB development site

MuleHashDB is a hash database management for your Mule. Currently it's only suposed to work with aMule since it has several cli tools, amulecmd, ed2k and alcc from where you can interact with aMule.

Basicly it's a simple "wraper" for the cli tools, that provides the access to the hash database. So, normaly when adding a new ED2k link to your Mule one would use ed2k, with MuleHashDB you add links like:

MuleHashDB.py -a "ed2k://link1...... ed2k://link2...... "

It first checks the database for a hash match(you could have downloaded a file with the same hash a year ago, and it longer lives on your HD). If an identical hash is found, the database entry is displayed and you're asked if you'd like to download it again. If it ain't found, the ED2k link details are added to the database(as not fully downloaded) and the ED2k link is then passed to the ed2k binary.

aMule has added a new functionality to version 2.1.0, ie, run a command when a file on your download list has completed. This will also interact with MuleHashDB, it will mark a database entry as complete. Here's how to setup your aMule:
(click to enlarge)

Available command line options

ArgsExplanationWhat to pass
-h, --help Display full help on what and how to pass to mhdb
--version Display version
-VDisplay long version, ie, with revision
-a, --addAdd ED2k link(s)valid ED2k link(s).
-d, --delDelete ED2k link(s)valid ED2k link(s) or hash(es).
-n, --no-muleDon't add ED2k link(s) to your Mule.
-c, --mark-completeMark a database entry as comlete.valid ED2k link(s) or hash(es).
-F, --fill-from-dl-listPopulate the database with the output of amulecmd -c 'show dl'.
-s, --statsProvides some statisticscomplete for completed entries;
incomplete for incomplete(not fully downloaded) entries;
today for entries completed today;
yesterday for entries completed yesterday;
all for all database entries.
--configPass an alternative configuration filepath to alternate config file
-D, --debugRun in debug mode.(more output)
-Q, --quietRun in debug mode.(no output unless errors occurr)

Dependencies

MuleHashDB depends on:

  • aMule or probably any Mule client that has a ed2k and ?mulecmd cli tool.
  • SQLObject 0.7
  • SQLite
  • pySQLite - MuleHashDB can support any SQL DB that SQLObject supports, you just need to contribute the code ;).

SQLite

If your distro doesn't make SQLite available to you, you can download pre-compiled binaries or the source. Info on how to install it should be on the SQLite site.

pySQLite

If your distro doesn't make pySQLite available to you, read on how to install it from source

SQLObject

If your distro doesn't make SQLObject available to you, here's how to install it from source:

It will download setuptools needed even to display the SQLObject setup.py --help message.
"This script requires setuptools version 0.6a5 to run (even to display help). I will attempt to download it for you (from http://cheeseshop.python.org/packages/2.4/s/setuptools/), but you may need to enable firewall access for this script first."

Download

You can download MuleHashDB from source(the development version):

svn co http://dev.ufsoft.org/MuleHashDB/svn/trunk .

Or download the first(hopefully stable) release of MuleHashDB:

Install

To install MuleHashDB, after check out, as root do:

./setup.py install

This will install the MuleHashDB module to Python's site-packages directory, and the mhdb python binary to /usr/bin.

To know more about what can be done with setup.py, simply do:

./setup.py --help

Or:

./setup.py COMMAND --help

If you have special installation needs, I advise you to read Installing Python Modules.

Setup

The first time MuleHashDB is ran after installed, it copies the default configuration file, which your really should edit to set it up. Mainly the path to the aMule directory, the ed2k and the amulecmd binaries path. Optionally you can pass an alternate config file with the --config argument.

Upgrade Database

In case of version changes, sometimes there's the need to upgrade the database. So, this first thing is to go to the SQLite interactive prompt with our and open our database:

sqlite3 /path/to/the/database

From Version 0.1.0 to 0.1.1

If you had run MuleHashDB-0.1.0, now, when you try MuleHashDB-0.1.1, you'll get some errors because the database layout has changed. To upgrade it, you should now be on the SQlite interactive shell, like so, do:

sqlite> ALTER TABLE ed2k_link ADD COLUMN rating VARCHAR(20) CHECK (rating in ('Not Rated', 'Invalid/Corrupt/Fake', 'Poor', 'Good', 'Fair', 'Excellent'));
sqlite> UPDATE ed2k_link SET rating='Not Rated';
sqlite> ALTER TABLE ed2k_link ADD COLUMN comment VARCHAR(200);

You can now hit CTRL-D to exit. Since those DB changes will only be used in MuleHashDB-0.2.0 there's nothing else to do for now...


Attachments