Page 1 of 1

Bittorrent usage via the command line or an API

Posted: 29 Aug 2007, 13:49
by wmnelis
I am wondering if anyone knows how to use the bittorrent capabilities of the Bubba server via either the command line or an API (if there is one). I would like to create a browser plugin that will automatically add torrent files into the download list.

Any ideas?

Posted: 31 Aug 2007, 04:22
by tor

We actually have this feature quite high on our wanted feature list. Only lack of time has stopped us from doing this :( It would be quite easy to implement this as a firefox plugin or perhaps even as a greasemonkey script.

But to provide some info on how this could be done. I think the easiest way to talk to the download manager is by doing regular http posts to the scripts.

You have to do two things to get this working.

First you have to authenticate yourself. This is simplest done by posting to say index.php with the parameters uid set to your username, passwd set to your password and submit set to anything you like. Depending on how you do this you might have to collect the cookie, PHPSESSID, that gets sent here.

Then to add a download do a post, with the cookie you got when logging in provided, to the script downloads.php with the parameters add_download set to "Add", url set to the url that you want to download, uuid to a guaranteed unique identifier prefixed with the string "ftd".

Then to log out, do a post to index.php with the parameter logout set to anything.

A few example using wget. Every example should be entered on one line.


Code: Select all

wget -o /dev/null  --no-check-certificate --keep-session-cookies --save-cookies cookies.txt --post-data='submit=yes&uid=myusername&passwd=mypassword'  https://bubba/web-admin/index.php
Add download:

Code: Select all

wget -o /dev/null --no-check-certificate --load-cookies cookies.txt --post-data='add_download=Add&uuid=ftd46d7d30bc6a1f&url=' https://bubba/web-admin/downloads.php
Log out:

Code: Select all

wget -o /dev/null --no-check-certificate --load-cookies cookies.txt --post-data='logout=yes' https://bubba/web-admin/index.php

bittorent using php and mysql

Posted: 29 May 2008, 15:25
by nb000
There is a bittorrent client, that runs over web
using only PHP any MYSQL.
It is called TorrentFlux.
I will try to install it soon, and see if it works ;-)

Posted: 29 May 2008, 15:32
by tor
nb000 and others of course,

Torrentflux on bubba howto and dont miss Bubbamon