Browser Integration

From MLDonkey
Jump to: navigation, search

How to add files to MLDonkey from various browsers.

TODO gather all browser extensions into nice table (as for Gui).


Mozilla Firefox

Extensions integrate FireFox with your MLDonkey server, allowing you to add torrents and other links (e.g., magnet, sigdat and ed2k) to the server's download queue with a single click :

A more complex method that works even for ancient versions of Firfox is a handler based hack.

Alternative to the above handler based hack is to use FlashGot extension and add a custom download manager, passing [URL] [REFERER] to a similar script (example for http URLs).


Gnome compliant browsers (Galeon,Epiphany,...) GNOME 2.8 and older

Galeon Users and users of other Gnome compliant applications, just install [mlurlslave for GTK+] or mlurlslave for GTK2
Alternately use instructions at mlurlslave but use /usr/bin/mldonkey_command instead of mlurlslave

However, if you happen to not have gnomecc --as is true for gnome2-- you still can set it up. Here goes: (we start at 4)

start gnome-control-center* go to complex (Komplex* in German) double-click on File Types and Programs (Dateitypen und Programme* in German) highlight Internet Services* click on Add Service...*

make sure Run in Terminal is unchecked* click OK*

You're done! Well I was... Now I can click on ed2k://-links and they are added to the queue.

If you have problems _please_ come by the IRC channel and look for me --housetier--, so we can sort it out. (Channel is #mldonkey on; see also the HomePage, under FAQs)

New GNOME 2 integration using gconf (GNOME 2.10 and newer)

Just install [mlurlslave for GTK+] or [mlurlslave for GTK2]

The filetypes and Programs capplet does not exist anymore in newer GNOME versions, so you'd have to add the handler directly to the gconf database. To do this you type:

(Oh yeah, I noticed that the telnet protocol changed somewhat, so you have to edit the mlurlslave file (/usr/local/bin/mlurlslave) and change the line elsif(/download started/){ to elsif(/Added link/){. If you don't do this, mlurlslave will give you an error message. The download is still started though. Test reaction with dllink in console when in doubt.)


Here is the code for konqueror_submit:


#Creates a link to submit to MLdonkey and submits using Konqueror

use URI::Escape;
$uri  = $ARGV[0];
# change these as needed
$username = "admin";
$password = "";
$server_addr = "localhost";
$server_port = "4080";

$link = sprintf("http://%s:%s@%s:%s/submit?q=dllink+%s",

exec ('konqueror',$link);

Edit and put in your path. Make sure you chmod +x konqueror_submit or it won't work.

This works for .torrent-files/links. To use it with the edk2 protocol, do:

Here is the protocol handler file that goes in .kde/shar/services/edk2.protocol

exec=konqueror_submit '%u'
Description=Handles eDonkey2000 ed2k://-links

RedZeus, source Forums&fileviewtopic&t=2462



(~HowTo found on the web @ in german - translated by fob)

in the section ~~User Prefs* add:


Find section ~~Trusted Applications* (create it if it does not exist) and add:

 or for Opera 7:
ed2k=/usr/bin/ed2kopera %u

create the file /usr/bin/ed2kopera* and insert the following text:

echo dllink ed2k://$1 || nc -q 1 4000

(Change \"\" and \"4000\" to fit the IP-Address and Portnumber that your mldonkey-core uses)

Unix v 8 Beta 2 (tested in Gentoo Linux-2.6.11-r4, Gnome 2.8.3)

Add protocol \"ed2k\"
Open with \"/home/userdir/ed2kopera\"
echo dllink $1 || nc -q 1 4000

(Change \"\" and \"4000\" to fit the IP-Address and Portnumber that your mldonkey-core uses)


In the root folder of the Opera installation (most probably C:\Program Files\Opera7) find the file 'opera6.ini'.

+Add in this file under ~~User Prefs


Find the same file in the subfolder 'profile' (most probably C:\Program Files\Opera7\profile).

+Add in this file under ~~Trusted Protocols

ed2k<code>0,0,opera.EXE ~http://admin:@</code>dllink+%1

And you are ready to click your favourite Ed2k links.

_(by White FrosT, only tested on Opera 7+)_

As a Side note with the particular version of opera I have (7.21) I had to use the following:

~[[~User Prefs]]
~[[~Trusted Protocols]]
ed2k=0,0, /usr/bin/ed2kopera %u

and nc -q wasn't valid so i changed that in the script above to nc -i



elinks browser ( can be customized with Lua scripts, so for this you need lua support enabled. Then, you have to modify your ~~/.elinks/hooks.lua file. In this file you can find the function called follow_url_hook. All web petitions go through this hook, which receives the URL the user has selected and it is either returned like that, or modified. We will modify it to detect ed2k and bittorrent links, and redirect them to our local mldonkey daemon.

First, somewhere add the following function used to reencode some bad characters found in URLs:

function url_encode(text)
    text = gsub(text, \" \", \"%%20\")
    text = gsub(text, \"%:\", \"%%3A\")
    text = gsub(text, \"%/\", \"%%2F\")
    text = gsub(text, \"%||\", \"%%7C\")
    text = gsub(text, \"%!\", \"%%21\")
    text = gsub(text, \"%�\", \"%%AA\")
    text = gsub(text, \"%&\", \"%%26\")
    return gsub(text, \"%#\", \"%%23\")

And now, before any processing is done in follow_url_hook, detect the urls. Example:

function follow_url_hook (url)

    -- Detecting ed2k links
    if strfind(url,'ed2k.*%||file%||') then
      text = url_encode(gsub(url, \"(.-)ed2k.'''file%||(~[[^]]''')%||(%d''')%||(%x''').*\", \"dllink ed2k://||file||%2%||%3%||%4%||\"))
      return \"~\"..text

    -- Detecting ~BitTorrent links
    if strfind(url,'.*%.torrent$') then
      return \"~\"..url_encode(url)

    -- Return url without changes.
    return url

All browsers using Sancho (only BitTorrent)

Sancho ( supports remote and local loading of a torrent direct from browser to mlnet. Assign browser to launch \"sancho -l %s\" for browser integration.

/usr/bin/sancho -l /home/username/somefile.torrent

Thats right this works even if the mlnet sancho is configured to access is on a remote machine.

All browsers using MLDonkey daemon running as user mldonkey (only BitTorrent)

Bash script to load local torrent

Another way to click on a bittorrent link and have it load in mldonkey is via a secondary script. Save this bash script as an executable in $HOME/bin. Assign your browser to launch the file when torrents are clicked on. Script and mldonkey must be on same system to work.

Note: The permissions and group may need to be fiddled with to get this script to work

Note: For mlnet on remote machine have torrent go to SMB shared directory and launch script on mlnet machine via auto ssh login and execution of script.

# Script to be called by web browser to load torrents to mldonkey
# Created by ProteusMoteus
# This is setup for mldonkey running as daemon process as
# user mldonkey.  As configured by mldonkey-init.

# Directory to move the .torrent to

if [[ [ ! -w \"$CLOSET\" | ! -s \"$1\" ]] ||] ||| ! $MLCMD; then
 [[ ! -s \"$1\" ]] && echo \"usage: mlbittorrent-script <torrent file>\"
 [[ ! -w \"$CLOSET\" ]] && echo ERR. Not writeable directory $CLOSET
 echo Given: $1
 CLOSET=\"$CLOSET/`basename \"$1\"`\"
 mv \"$1\" \"$CLOSET\"
 echo Moved to: $CLOSET
 ls -la \"$CLOSET\"
# Two lines below may need to be tweaked to get script to work
 chmod 660 \"$CLOSET\"
 chgrp mldonkey \"$CLOSET\"
 echo Changed permissions and group
 ls -l \"$CLOSET\"
 $MLCMD dllink \"$CLOSET\"
 echo Check downloads for file:
 echo \"$MLCMD vd || grep `basename \"$CLOSET\" .torrent`\"
 [[[ \"$CLOSET\" != *.torrent ]]] && echo WARNING. No torrent extension for $CLOSET

#enable for troubleshooting
#echo Press [[ENTER]] to continue

Internet Explorer

It seems to be possible to hack the registry to support ed2k links. See mlsubmit.reg

DonkeyInput registers itself as e2dk protocol handler and works under Windows. Tested with IE and FireFox.

Google Chrome




GetEd2k - Android application to handle ed2k links

See also

Forum: how to download bittorrent with mldonkey?


Personal tools