Difference between revisions of "Ed2k links handling"

From AMule Project FAQ
Jump to: navigation, search
(Added instructions for links-hacked (and presumably other links versions, too) Greetings from Alex <alex@22-music.de>)
m (Removed broken file link)
 
(95 intermediate revisions by 36 users not shown)
Line 1: Line 1:
The way to have [[aMule]] handle your [[ed2k links]] on your favorite WebBrowser will depend on which WebBrowser you use. So, here's a list of mini-HowTos for each of the most popular WebBrowsers.
+
<center>
Have in mind that everywhere on this document, ''/path/to/ed2k'' should be replaced with ''/usr/local/bin/ed2k'', ''/usr/bin/ed2k'', ''C:\Program Files\aMule\ed2k.exe'' or whatever, depending on your own system's configuration.
+
'''English''' |
 +
[[Ed2k_links_handling-de|Deutsch]] |
 +
[[Ed2k_links_handling-nl|Nederlands]] |
 +
[[Ed2k_links_handling-ko_KR|Korean]] |
 +
[[Ed2k_links_handling-es|Español]]
 +
</center>
  
As a general idea, in most [http://www.kernel.org Linux] systems, self-compiled [[aMule]]s will install the [[FAQ_ed2k|ed2k]] utility in ''/usr/local/bin/ed2k'', while package-installed [[aMule]]s will install it in ''/usr/bin/ed2k''. As an exception, it is known that [http://www.suse.com SuSE] packages install it in ''/usr/local/bin/ed2k''.
+
The way to make [[aMule]] handle your [[ed2k link|ed2k links]] on your favorite web browser will depend on which web browser you use and which operating system you have installed. So, here's a list of mini-HowTos for each of the most popular web browsers and operating systems.
  
== [http://www.microsoft.com/windows/ie Internet Explorer] ==
+
Have in mind that everywhere on this document, ''/path/to/ed2k'' should be replaced with ''/usr/local/bin/ed2k'', ''/usr/bin/ed2k'', ''c:\Program Files\aMule\ed2k.exe'' or whatever, depending on your own system's configuration.
'''by ''[[User:Jacobo221|Jacobo221]]'''''
+
  
Go to "Start" -> "Run" and run "regedit" (without quotes).
+
= Local handling of ed2k links =
Now, in regedit, get to ''HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ed2k\shell\open''<br>
+
== GNU/Linux ==
It could happen that ''ed2k'' didn't exist. In such case, create it by selecting "New" -> "Key" and entering ''ed2k'' as value. Then do the same with ''shell'' and ''open''.<br>
+
As a general idea, in most [http://www.kernel.org Linux] systems, self-compiled [[aMule]]s will install the [[FAQ_ed2k_command|ed2k]] utility in ''/usr/local/bin/ed2k'', while package-installed [[aMule]]s will install it in ''/usr/bin/ed2k''. As an exception, it is known that [http://www.opensuse.org SuSE] packages install it in ''/usr/local/bin/ed2k''.
Once inside the ''open'' key, if ''command'' exists, just double click on it, but if it doesn't, go to "New" -> "Value" and enter the path to the ed2k application as an ASCII string value, followed by ''"%1"'' (with quotes), so you should end with some value like ''C:\Program Files\aMule2\ed2k "%1"''.
+
  
== [http://www.konqueror.org Konqueror] ==
+
If you have installed Debian or Ubuntu '''you must install''' "'''amule-utils'''" (and "'''amule-ed2k'''" only for Debian) to get this way working.
'''by ''gfdsa'''''
+
  
''/usr/kde/3.1/share/services'' you can find it by file names ended with ''.protocol'' kinda ''`find /usr -name "*.protocol"`'' or ''`find /opt -name "*.protocol"`'' or even put ''/'' to path if you want.
+
To know where amule and ed2k are located, just do ''which amule'' and ''which ed2k'' in console!
  
If the search was successful, create a file named like ''ed2k.protocol'' in
+
=== [http://www.mozilla.org/products/firefox Firefox] 2 and 3 (or later)===
the mentioned directory:
+
Handling ED2k links in Firefox can be configured in two ways: either for an individual user, or for all users of the computer.
  
<code>[Protocol]<br>
+
==== Configuration for a single user ====
exec=/path/to/ed2k "%u"<br>
+
*Insert ''about:config'' in the address bar
protocol=ed2k<br>
+
 
input=none<br>
+
*Right click on the list, select '''New''', then '''Boolean'''; insert ''network.protocol-handler.external.ed2k'' as '''Preference Name''' and ''true'' as '''Value'''
output=none<br>
+
 
helper=true<br>
+
*Now another right click, select '''New''' and '''String'''; insert ''network.protocol-handler.app.ed2k'' as '''Preference Name''' and ''/path/to/ed2k'' (path to where the file is installed on your system) as '''Value'''.
listing=false<br>
+
 
reading=false<br>
+
For Ubuntu Lucid users, you should set the Value to just "ed2k" instead of "/usr/bin/ed2k".
writing=false<br>
+
 
makedir=false<br>
+
For Firefox 3 and higher only, you should also:
deleting=false</code>
+
 
 +
*Right click on the list, select '''New''', then '''Boolean'''; insert ''network.protocol-handler.expose.ed2k'' as '''Preference Name''' and ''false'' as '''Value'''
 +
 
 +
After that, click over an ed2k link, and Firefox should ask which app you want to use to open the link. Choose /usr/bin/ed2k and it should work.
 +
 
 +
[[Image:Ed2k-ff3.png]]
 +
 
 +
==== System-wide configuration ====
 +
*Having root privileges, open the file ''/usr/share/firefox/greprefs/all.js'' (or ''/usr/local/share/firefox/greprefs/all.js'') in a text editor
 +
 
 +
*Add the following lines at the end of the file:
 +
// ED2K link handling
 +
pref("network.protocol-handler.external.ed2k", true);
 +
pref("network.protocol-handler.app.ed2k", "/path/to/ed2k");
 +
Substitute the "/path/to/ed2k" string with the program's real path.
 +
 
 +
For Firefox 3 and higher only:
 +
*Add yet another line to the ''all.js''file:
 +
pref("network.protocol-handler.expose.ed2k", false);
 +
 
 +
After saving changes, restart the browser. After clicking over an ed2k link, Firefox should ask which app you want to use to open the link. Choose /usr/local/bin/ed2k and it should work.
 +
 
 +
==== Add multiple downloads to aMule at once ====
 +
Setup Firefox as already explained and install the [https://addons.mozilla.org/fr/firefox/addon/firemule/ FireMule] module for Firefox.
 +
 
 +
=== [http://wiki.debian.org/Iceweasel Iceweasel] ===
 +
 
 +
==== Configuration for a single user ====
 +
In addition to what was said for Firefox, do the following:
 +
*Right click on the list, select '''New''', then '''Boolean'''; insert ''network.protocol-handler.warn-external.ed2k'' as '''Preference Name''' and ''true'' as '''Value'''.
 +
This is necessary so that Iceweasel asks you which application you want to use to open the link.
 +
 
 +
=== [http://www.opera.com Opera]  ===
 +
 
 +
In [http://www.opera.com Opera] go to ''Tools -> Preferences -> Programms -> Add...''
 +
 
 +
In the "Protocol" field enter ''ed2k''
 +
 
 +
In the "Open with another application" field enter ''/path/to/ed2k''
 +
 
 +
[[Image:Ed2k-op.png]]
 +
 
 +
=== [http://www.konqueror.org Konqueror] ===
 +
To have ed2k links work from [http://www.konqueror.com Konqueror] you have to add a protocol-file to the directory with the other protocol-files. You can find this directory by searching for file names ending with ''.protocol''. To search run ''`find /usr -name "*.protocol"`'' or ''`find /opt -name "*.protocol"`''. If you're not sure about the directory where KDE is installed you can even put ''/'' as search path.
 +
 
 +
If the search was successful, create a file named like ''ed2k.protocol'' in the mentioned directory:
 +
[Protocol]
 +
exec=/path/to/ed2k "%u"
 +
protocol=ed2k
 +
input=none
 +
output=none
 +
helper=true
 +
listing=false
 +
reading=false
 +
writing=false
 +
makedir=false
 +
deleting=false
  
 
Now just restart [http://www.konqueror.org Konqueror].
 
Now just restart [http://www.konqueror.org Konqueror].
  
== [http://www.opera.com Opera]  ==
+
'''NOTE:''' You might get a security warning. don't worry. it is just warning you that the link is being sent to an external application.
'''by ''thermoman [Marcel Meckel]'', ''ender'' and ''[[User:Jacobo221|Jacobo221]]''
+
  
Edit ''/etc/opera6rc'' as root or ''~/.opera/opera6.ini'' as non-root:
+
'''NOTE2:''' If after clicking ''OK'' on the security warning the link is still not being sent to [[aMule]], just right-click on the [[ed2k link]] and tell [http://www.konqueror.org Konqueror] to open it in a new window/tab.
  
<code>[User Prefs]<br>
+
=== [http://galeon.sourceforge.net Galeon] ===
TrustedExternalURLProtocols=ed2k
+
  
[Trusted Applications]<br>
+
Execute the following three commands to create the appropriate ''gconf'' keys:
ed2k=/path/to/ed2k ed2k://%u</code>
+
  
Or an easier way:<br>
+
*''gconftool-2 -t string -s /desktop/gnome/url-handlers/ed2k/command "/usr/bin/ed2k \"%s\""''
open ''Tools->Preferences->Paths and Programms->Add...''<br>
+
*''gconftool-2 -t bool -s /desktop/gnome/url-handlers/ed2k/enabled true''
protocol = ed2k<br>
+
*''gconftool-2 -t bool -s /desktop/gnome/url-handlers/ed2k/needs_terminal false''
choose the path: ''/path/to/ed2k''
+
  
'''[http://www.opera.com Opera] 6''' doesn't pass complete URL to external programs; only URL without protocol. The way to walk around this follows.
+
Replace "''/usr/bin/ed2k''" above with the path and name of the ''ed2k'' executable on your system.
  
<u>In [http://www.kernel.org Linux] or some other Unix-like flavour</u><br>
+
Uninstalling this protocol handler is similarly simple:
Create ''amule_submit.sh'' with this content:
+
*''gconftool-2 -u /desktop/gnome/url-handlers/ed2k --recursive-unset''
  
<code>#!/bin/sh<br>
+
=== [http://xray.sai.msu.ru/~karpov/links-hacked Links] ===
/path/to/ed2k "ed2k://$1"</code>
+
(Probably this will work for the usual links and/or [[ed2k link|elinks]], too)
  
Change ''ed2k=/path/to/ed2k ed2k://%u'' with ''ed2k=/path/to/amule_submit.sh  ed2k://%u''
+
add to ''url.c'' behind the lines about telnet and tn3270:
 +
  ''--snip''
 +
  ''{"ed2k", 0, NULL, ed2k_func, 0, 0, 0},''
 +
  ''--snap''
  
<u>In Windows systems</u><br>
+
add to ''links.h'' behind the definitions of /* mailto.c */:
Crate ''amule_submit.bat'' with this content:
+
  ''--snip''
 +
  ''void ed2k_func(struct session *, unsigned char *);''
 +
  ''--snap''
  
''X:\path\to\ed2k.exe "ed2k://%1"''
+
add to ''mailto.c'' at the end:
 +
  ''--snip''
 +
  ''void ed2k_func(struct session *ses, unsigned char *url)''
 +
  ''{''
 +
  ''tn_func(ses, url, options_get("network_program_ed2k"), TEXT(T_ED2K), TEXT(T_BAD_ED2K_URL));''
 +
  ''}''
 +
  ''--snap''
  
Change ''ed2k=/path/to/ed2k ed2k://%u'' with ''ed2k=X:\path\to\amule_submit.bat ed2k://%u''
+
add to ''options_register.c'' behind telnet and tn3270:
 +
  ''--snip''
 +
  ''register_option_char("network_program_ed2k", TEXT(T_ED2K_PROG),NULL,2);''
 +
  ''--snap''
  
== [http://www.mozilla.org Mozilla] 1.7 (or later) & [http://www.mozilla.org/products/firefox Firefox] 0.9 ==
+
add to ''intl/*.lng'' behind
'''by ''GhePeU'''''
+
  ''"T_TN3270_PROG": T_ED2K_PROG, "ed2k program",'' (or whatever that is in your language), behind
 +
  ''"T_TN3270": T_ED2K, "ed2k",'' and behind
 +
  ''"T_BAD_TN3270_URL": T_BAD_ED2K_URL'' (I guess you've got the picture)
  
Mozex doesn't work anymore with [http://www.mozilla.org Mozilla] 1.7 and [http://www.mozilla.org/products/firefox Firefox] 0.9. There is an alternate method that seems to be working with both of them:
+
If you want to automatize this stuff, execute the following commands:
 +
  ''cd intl''
 +
  ''for l in *.lng; do''
 +
    ''cp $l $l.bak''
 +
    ''cat $l.bak | sed -e "/T_TN3270_PROG*/aT_ED2K_PROG\, \"ed2k program\"\," \''
 +
    ''-e "/T_TN3270,\ */aT_ED2K\, \"ed2k\"\," \''
 +
    ''-e "/T_BAD_TN3270_URL*/aT_BAD_ED2K_URL\, \"Bad ed2k url\"\," > $l''
 +
  ''done''
 +
 
 +
Anyway, run afterwards before recompiling links-hacked:
 +
  ''./synclang''
 +
  ''cd ..''
  
*Remove [http://mozex.mozdev.org/installation.html MozEx] if installed or at least remove the ed2k input from it (only if [http://mozex.mozdev.org/installation.html MozEx] is installed)
+
Now you can compile with
 +
  ''./configure'' (add your favourite options here) ''&&''
 +
  ''make &&''
 +
  ''make install''
  
*Insert ''about:config'' in the address bar
+
Because links somewhat malforms the urls, we need a small bash script handler:
 +
  ''cat > /usr/bin/ed2k4links.sh << "EOF"''
 +
  ''#!/bin/bash''
 +
  ''ed2k $(echo "ed2k://$1" | sed s/_/\|/g)''
 +
  ''EOF''
 +
  ''chmod a+x /usr/bin/ed2k4links.sh''
  
*Right click on the list, select '''New''', then '''Boolean'''; insert ''network.protocol-handler.external.ed2k'' as '''Preference Name''' and ''true'' as '''Value'''
+
Do not forget to setup links (Options->Network Options->Mail and Telnet Programs) to call our ''ed2k4links.sh'' for [[ed2k link]]s:
 +
  ''ed2k4links.sh %''
  
*Now another right click, select '''New''' and '''String'''; insert ''network.protocol-handler.app.ed2k'' as '''Preference Name''' and ''/path/to/ed2k'' (or path to where the file is installed on you system) as '''Value'''.
+
Attention: The Percent Mark is important! Now links should work with [[ed2k link]]s.
  
== [http://www.mozilla.org Mozilla] 1.3 to 1.6 & [http://www.mozilla.org/products/firefox Firebird] v0.6 & [http://www.mozilla.org/products/firefox Firefox] v0.8 ==
+
== Windows ==
'''by ''DeltaHF'''''
+
To make Windows aware of the ed2k link protocol we need to add some keys to the registry. Create a file called ed2k.reg and add this code:
 +
REGEDIT4
 +
 +
[HKEY_CLASSES_ROOT\ed2k]
 +
@="URL: ed2k Protocol"
 +
"URL Protocol"=""
 +
 +
[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
 +
@="C:\\Program Files\\aMule\\amulegui.exe"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell]
 +
@="open"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open]
 +
   
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
 +
@="\"C:\\Program Files\\aMule\\ed2k\" \"%1\""
 +
Save the file and run it (double click) to add these keys to the registry.
  
Go to [http://mozex.mozdev.org/installation.html MozEx's WebPage] and install the ''mozex-1.07.xpi'' file.<br>
+
If your config directory is in d:\amule\config instead of the default place you have to pass it as an option:
Restart your [http://www.mozilla.org Mozilla]/[http://www.mozilla.org/products/firefox FireBird]/[http://www.mozilla.org/products/firefox FireFox], go to Edit -> Preferences -> mozex -> ED2K and set it to ''/path/to/ed2k %r''<br>
+
[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
Click '''OK''' and you're done.
+
@="\"C:\\Program Files\\aMule\\ed2k\" -c d:\\amule\\config \"%1\""
  
<u>Note for Firefox 0.8 users</u><br>
+
=== [http://www.microsoft.com/windows/ie Internet Explorer] ===
Instead of Edit -> Preferences -> mozex -> ED2K, you'll find [http://mozex.mozdev.org/installation.html MozEx]'s preferences at Edit -> Preferences -> Extensions -> mozex -> Options -> ED2K
+
Internet Explorer will recognize ed2k links with just the changes in the registry.
  
== [http://www.mozilla.org Mozilla] 1.2.1 or earlier  ==
+
== Mac OS X ==
'''by ''rpokorny [R. Pokorny]'''''
+
  
1) Go to [http://protozilla.mozdev.org/download.html Protozilla's WebPage]<br>
+
Adapted from Ken's post in the [http://forum.amule.org/index.php?topic=5679.msg30209#msg30209 forum].
Choose the version fitting your [http://www.mozilla.org Mozilla]-version and click on '''Install'''. It will auto-install [http://protozilla.mozdev.org Protozilla].<br>
+
Now close [http://www.mozilla.org Mozilla] completely.
+
  
<u>Notes for [http://www.kernel.org Linux] and other Unix-like systems users</u><br>
+
# Run aMule at least once
- You must have write permission to the [http://www.mozilla.org Mozilla] installation directory. If you've installed [http://www.mozilla.org Mozilla] in ''/usr'', you'll have to be '''root''' probably.<br>
+
# Run Safari (even if you normally use Firefox or another browser)
- The downloadable precompiled version of [http://protozilla.mozdev.org Protozilla] apparently does '''not''' work with [http://www.debian.org Debian]'s [http://www.mozilla.org Mozilla] packages. It '''does''' work together with the precompiled version of 1.2.1 available at [http://www.mozilla.org Mozilla's WebPage] for example (or you can build both [http://www.mozilla.org Mozilla] and [http://protozilla.mozdev.org Protozilla] yourself).
+
# Browse to a page with an ed2k link that you want to download
 +
# Drag the link to the location field at the top of the window
 +
# The OS will present a dialog asking if you want to allow a program to run to handle the link. Allow it.
  
2) This step is only necessary if you had to start [http://www.mozilla.org Mozilla]/[http://www.mozilla.org/products/firefox FireBird]/[http://www.mozilla.org/products/firefox FireFox] as '''root''' in step 1.
+
Now, the program that helps aMule handle ed2k links is known to the system.
  
As '''root''' do:
+
=== Safari ===
''cp -r /root/.mozilla/PROFILENAME/RANDOM.slt/protozilla/ /home/USERNAME/.mozilla/PROFILENAME2/RANDOM.slt/''
+
If you use Safari, you will have to drag the link to the location field every time.  For unclear reasons, Safari will not process ed2k (or other non-Apple protocol) links if you click on them.
  
This will have copied protozilla-configuration from root's home directory to user's home directory.
+
=== Firefox ===
 +
If you use Firefox, clicking on an ed2k link will work. The first time, for security purposes, Firefox will present a dialog asking if you want to allow the helper program to run. (Yes, even though the OS already asked you the same question.) After that, it will work just as you would expect.
  
''cd /home/USERNAME/.mozilla/PROFILENAME/RANDOM.slt/
+
= Remote handling of ed2k links =
chown -R YOURUSER.YOURGROUP protozilla''
+
You can also handle links remotely, which means that you click over an [[ed2k link]] in a browser somewhere in the world and it gets into your home's [[aMule]] queue. It works by using [[aMuleCMD]] instead of using the [[ed2k command]].
  
This will have changed file-ownership parameters in user's files.
+
== Linux ==
 +
Instead of using the [[ed2k command]], use the following as the command to use:
  
<u>Note:</u><br>
+
''/'''path'''/'''to'''/amulecmd -h $server -P $pw -c "Add %u"
'''USERNAME:''' Name of your normal, non-root user.<br>
+
'''PROFILENAME:''' Name of the profile you'll want to use.<br>
+
'''RANDOM:''' Random alphanumeric string, autogenerated by mozilla.<br>
+
'''YOURUSER, YOURGROUP:''' User and group of your normal user.<br>
+
  
3) Setup a protocol-handler for [[ed2k links]]:<br>
+
Obviously, you'll have to replace ''$server'' and ''$pw'' with your server's [[IP address|IP]] (or [http://www.webopedia.com/TERM/D/DNS.html DNS]) and your [[External Connections]] password.
''cd ~/.mozilla/PROFILENAME/RANDOM.slt/protozilla/protocol''
+
  
create a file called ''ed2k.cmd'' with the following content:
+
'''NOTE:''' In [http://www.mozilla.org Firefox], it is not possible to start a command with parameters. An easy solution is a shell script with the command described above. You only have to replace %u with $1. This shell script must be executable (chmod +x ed2k.sh) and defined as external ed2k app in Firefox.
  
''ed2k ed2k:$URI_DATA''
+
== Windows ==
 +
Make sure aMule is installed with the [[aMuleCMD]] option checked.
  
(The file doesn't need to be executable).
+
We need a batch script to handle the ed2k links from the browser, and we need to add some keys to the registry to make the browser recognize the ed2k links. Things are different for 32 and 64 bit versions of Windows so pick the right section below. After you created the files and updated the registry, configure your browser if neccesary.
  
Now restart [http://www.mozilla.org Mozilla].
+
=== 32 bit ===
 +
Create a file named '''ed2k_remote.bat''' containing the following code:
 +
@echo off
 +
set link=%1
 +
for /f "useback tokens=*" %%a in ('%link%') do set link=%%~a
 +
"c:\Program Files\aMule\amulecmd.exe" /h '''server''' /P '''pass''' /c "add %link%"
 +
Don't forget to replace '''server''' and '''pass''' with your data and save the file in your aMule directory ''C:\Program Files\aMule''.
  
== [http://xray.sai.msu.ru/~karpov/links-hacked/ links-hacked*] ==
+
Create a file named '''ed2k_remote.reg''' containing the following code:
(* probably this will work for the usual links and/or elinks, too)
+
REGEDIT4
 +
 +
[HKEY_CLASSES_ROOT\ed2k]
 +
@="URL: ed2k Protocol"
 +
"URL Protocol"=""
 +
 +
[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
 +
@="C:\\Program Files\\aMule\\amulegui.exe"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell]
 +
@="open"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open]
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
 +
@="\"C:\\Program Files\\aMule\\ed2k_remote.bat\" \"%1\""
 +
Save the file and run it (double click) to add these keys to the registry.
  
add to url.c behind the lines about telnet and tn3270:
+
=== 64 bit ===
  --snip
+
Create a file named '''ed2k_remote.bat''' containing the following code:
  {"ed2k", 0, NULL, ed2k_func, 0, 0, 0},
+
@echo off
  --snap
+
set link=%1
 +
for /f "useback tokens=*" %%a in ('%link%') do set link=%%~a
 +
"c:\Program Files (x86)\aMule\amulecmd.exe" /h '''server''' /P '''pass''' /c "add %link%"
 +
Don't forget to replace '''server''' and '''pass''' with your data and save the file in your aMule directory ''C:\Program Files (x86)\aMule''.
  
add to links.h behind the definitions of /* mailto.c */:
+
Create a file named '''ed2k_remote_64.reg''' containing the following code:
  --snip
+
REGEDIT4
  void ed2k_func(struct session *, unsigned char *);
+
  --snap
+
[HKEY_CLASSES_ROOT\ed2k]
 +
@="URL: ed2k Protocol"
 +
"URL Protocol"=""
 +
 +
[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
 +
@="C:\\Program Files (x86)\\aMule\\amulegui.exe"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell]
 +
@="open"
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open]
 +
 +
[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
 +
@="\"C:\\Program Files (x86)\\aMule\\ed2k_remote.bat\" \"%1\""
 +
Save the file and run it (double click) to add these keys to the registry.
  
add to mailto.c at the end:
+
=== Internet Explorer ===
  --snip
+
You should be OK with just the changes to the registry and the batch script in your aMule directory.
  void ed2k_func(struct session *ses, unsigned char *url)
+
  {
+
  tn_func(ses, url, options_get("network_program_ed2k"), TEXT(T_ED2K), TEXT(T_BAD_ED2K_URL));
+
  }
+
  --snap
+
  
add to options_register.c behind telnet and tn3270:
+
=== Safari ===
  --snip
+
Safari will take over the settings in the registry, like Internet Explorer.
  register_option_char("network_program_ed2k", TEXT(T_ED2K_PROG),NULL,2);
+
  --snap
+
  
add to intl/*.lng behind
+
=== Chrome ===
  "T_TN3270_PROG": T_ED2K_PROG, "ed2k program", (or whatever that is in your language), behind
+
Chrome will take over the settings in the registry. It asks for confirmation, so tick the "Don't ask me again" box.
  "T_TN3270": T_ED2K, "ed2k", and behind
+
  "T_BAD_TN3270_URL": T_BAD_ED2K_URL (I guess you've got the picture)
+
  
If you want to automatize this stuff, execute the following commands:
+
=== Firefox ===
  cd intl
+
The first time you click an ed2k link in Firefox you will get the following dialog:
  for l in *.lng; do
+
    cp $l $l.bak
+
    cat $l.bak | sed -e "/T_TN3270_PROG*/aT_ED2K_PROG\, \"ed2k program\"\," \
+
    -e "/T_TN3270,\ */aT_ED2K\, \"ed2k\"\," \
+
    -e "/T_BAD_TN3270_URL*/aT_BAD_ED2K_URL\, \"Bad ed2k url\"\," > $l
+
  done
+
 
+
Anyway, run afterwards before recompiling links-hacked:
+
  ./synclang
+
  cd ..
+
  
Now you can compile with
+
[[Image:Firefox ed2k link.PNG]]
  ./configure (add your favourite options here) &&
+
  make &&
+
  make install
+
  
Because links somewhat malforms the urls, we need a small bash script handler:
+
Tick the Remember box and click OK.
  cat > /usr/bin/ed2k4links.sh << "EOF"
+
 
  #!/bin/bash
+
=== Opera ===
  ed2k $(echo "ed2k://$1" | sed s/_/\|/g)
+
Open the preferences window and click the Programs tab
  EOF
+
  chmod a+x /usr/bin/ed2k4links.sh 
+
  
Do not forget to setup links (Options->Network Options->Mail and Telnet Programs) to call our ed2k4links.sh for ed2k links:
+
[[Image:Opera preferences programs.PNG]]
  ed2k4links.sh %
+
  
Attention: The Percent Mark is important! Now links should work with ed2k links.
+
Click the Add... button
  
==  More information  ==
+
Make Opera aware of the ed2k link protocol with these settings:
  
If the above information didn't help you enough, take a look at [http://www.amule.org/amule/ed2k.php http://www.amule.org/amule/ed2k.php]
+
[[Image:Opera_protocols_ed2k.PNG]]

Latest revision as of 08:40, 11 December 2016

English | Deutsch | Nederlands | Korean | Español

The way to make aMule handle your ed2k links on your favorite web browser will depend on which web browser you use and which operating system you have installed. So, here's a list of mini-HowTos for each of the most popular web browsers and operating systems.

Have in mind that everywhere on this document, /path/to/ed2k should be replaced with /usr/local/bin/ed2k, /usr/bin/ed2k, c:\Program Files\aMule\ed2k.exe or whatever, depending on your own system's configuration.

Local handling of ed2k links

GNU/Linux

As a general idea, in most Linux systems, self-compiled aMules will install the ed2k utility in /usr/local/bin/ed2k, while package-installed aMules will install it in /usr/bin/ed2k. As an exception, it is known that SuSE packages install it in /usr/local/bin/ed2k.

If you have installed Debian or Ubuntu you must install "amule-utils" (and "amule-ed2k" only for Debian) to get this way working.

To know where amule and ed2k are located, just do which amule and which ed2k in console!

Firefox 2 and 3 (or later)

Handling ED2k links in Firefox can be configured in two ways: either for an individual user, or for all users of the computer.

Configuration for a single user

  • Insert about:config in the address bar
  • Right click on the list, select New, then Boolean; insert network.protocol-handler.external.ed2k as Preference Name and true as Value
  • Now another right click, select New and String; insert network.protocol-handler.app.ed2k as Preference Name and /path/to/ed2k (path to where the file is installed on your system) as Value.

For Ubuntu Lucid users, you should set the Value to just "ed2k" instead of "/usr/bin/ed2k".

For Firefox 3 and higher only, you should also:

  • Right click on the list, select New, then Boolean; insert network.protocol-handler.expose.ed2k as Preference Name and false as Value

After that, click over an ed2k link, and Firefox should ask which app you want to use to open the link. Choose /usr/bin/ed2k and it should work.

Ed2k-ff3.png

System-wide configuration

  • Having root privileges, open the file /usr/share/firefox/greprefs/all.js (or /usr/local/share/firefox/greprefs/all.js) in a text editor
  • Add the following lines at the end of the file:
// ED2K link handling
pref("network.protocol-handler.external.ed2k", true);
pref("network.protocol-handler.app.ed2k", "/path/to/ed2k");

Substitute the "/path/to/ed2k" string with the program's real path.

For Firefox 3 and higher only:

  • Add yet another line to the all.jsfile:
pref("network.protocol-handler.expose.ed2k", false);

After saving changes, restart the browser. After clicking over an ed2k link, Firefox should ask which app you want to use to open the link. Choose /usr/local/bin/ed2k and it should work.

Add multiple downloads to aMule at once

Setup Firefox as already explained and install the FireMule module for Firefox.

Iceweasel

Configuration for a single user

In addition to what was said for Firefox, do the following:

  • Right click on the list, select New, then Boolean; insert network.protocol-handler.warn-external.ed2k as Preference Name and true as Value.

This is necessary so that Iceweasel asks you which application you want to use to open the link.

Opera

In Opera go to Tools -> Preferences -> Programms -> Add...

In the "Protocol" field enter ed2k

In the "Open with another application" field enter /path/to/ed2k

Ed2k-op.png

Konqueror

To have ed2k links work from Konqueror you have to add a protocol-file to the directory with the other protocol-files. You can find this directory by searching for file names ending with .protocol. To search run `find /usr -name "*.protocol"` or `find /opt -name "*.protocol"`. If you're not sure about the directory where KDE is installed you can even put / as search path.

If the search was successful, create a file named like ed2k.protocol in the mentioned directory:

[Protocol]
exec=/path/to/ed2k "%u"
protocol=ed2k
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false

Now just restart Konqueror.

NOTE: You might get a security warning. don't worry. it is just warning you that the link is being sent to an external application.

NOTE2: If after clicking OK on the security warning the link is still not being sent to aMule, just right-click on the ed2k link and tell Konqueror to open it in a new window/tab.

Galeon

Execute the following three commands to create the appropriate gconf keys:

  • gconftool-2 -t string -s /desktop/gnome/url-handlers/ed2k/command "/usr/bin/ed2k \"%s\""
  • gconftool-2 -t bool -s /desktop/gnome/url-handlers/ed2k/enabled true
  • gconftool-2 -t bool -s /desktop/gnome/url-handlers/ed2k/needs_terminal false

Replace "/usr/bin/ed2k" above with the path and name of the ed2k executable on your system.

Uninstalling this protocol handler is similarly simple:

  • gconftool-2 -u /desktop/gnome/url-handlers/ed2k --recursive-unset

Links

(Probably this will work for the usual links and/or elinks, too)

add to url.c behind the lines about telnet and tn3270:

 --snip
 {"ed2k", 0, NULL, ed2k_func, 0, 0, 0},
 --snap

add to links.h behind the definitions of /* mailto.c */:

 --snip
 void ed2k_func(struct session *, unsigned char *);
 --snap

add to mailto.c at the end:

 --snip
 void ed2k_func(struct session *ses, unsigned char *url)
 {
 tn_func(ses, url, options_get("network_program_ed2k"), TEXT(T_ED2K), TEXT(T_BAD_ED2K_URL));
 }
 --snap

add to options_register.c behind telnet and tn3270:

 --snip
 register_option_char("network_program_ed2k", TEXT(T_ED2K_PROG),NULL,2);
 --snap

add to intl/*.lng behind

 "T_TN3270_PROG": T_ED2K_PROG, "ed2k program", (or whatever that is in your language), behind
 "T_TN3270": T_ED2K, "ed2k", and behind 
 "T_BAD_TN3270_URL": T_BAD_ED2K_URL (I guess you've got the picture)

If you want to automatize this stuff, execute the following commands:

 cd intl
 for l in *.lng; do
   cp $l $l.bak
   cat $l.bak | sed -e "/T_TN3270_PROG*/aT_ED2K_PROG\, \"ed2k program\"\," \
    -e "/T_TN3270,\ */aT_ED2K\, \"ed2k\"\," \
    -e "/T_BAD_TN3270_URL*/aT_BAD_ED2K_URL\, \"Bad ed2k url\"\," > $l
 done
 

Anyway, run afterwards before recompiling links-hacked:

 ./synclang
 cd ..

Now you can compile with

 ./configure (add your favourite options here) &&
 make &&
 make install

Because links somewhat malforms the urls, we need a small bash script handler:

 cat > /usr/bin/ed2k4links.sh << "EOF"
 #!/bin/bash
 ed2k $(echo "ed2k://$1" | sed s/_/\|/g)
 EOF
 chmod a+x /usr/bin/ed2k4links.sh

Do not forget to setup links (Options->Network Options->Mail and Telnet Programs) to call our ed2k4links.sh for ed2k links:

 ed2k4links.sh %

Attention: The Percent Mark is important! Now links should work with ed2k links.

Windows

To make Windows aware of the ed2k link protocol we need to add some keys to the registry. Create a file called ed2k.reg and add this code:

REGEDIT4

[HKEY_CLASSES_ROOT\ed2k]
@="URL: ed2k Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
@="C:\\Program Files\\aMule\\amulegui.exe"

[HKEY_CLASSES_ROOT\ed2k\shell]
@="open"

[HKEY_CLASSES_ROOT\ed2k\shell\open]

[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
@="\"C:\\Program Files\\aMule\\ed2k\" \"%1\""

Save the file and run it (double click) to add these keys to the registry.

If your config directory is in d:\amule\config instead of the default place you have to pass it as an option:

[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
@="\"C:\\Program Files\\aMule\\ed2k\" -c d:\\amule\\config \"%1\""

Internet Explorer

Internet Explorer will recognize ed2k links with just the changes in the registry.

Mac OS X

Adapted from Ken's post in the forum.

  1. Run aMule at least once
  2. Run Safari (even if you normally use Firefox or another browser)
  3. Browse to a page with an ed2k link that you want to download
  4. Drag the link to the location field at the top of the window
  5. The OS will present a dialog asking if you want to allow a program to run to handle the link. Allow it.

Now, the program that helps aMule handle ed2k links is known to the system.

Safari

If you use Safari, you will have to drag the link to the location field every time. For unclear reasons, Safari will not process ed2k (or other non-Apple protocol) links if you click on them.

Firefox

If you use Firefox, clicking on an ed2k link will work. The first time, for security purposes, Firefox will present a dialog asking if you want to allow the helper program to run. (Yes, even though the OS already asked you the same question.) After that, it will work just as you would expect.

Remote handling of ed2k links

You can also handle links remotely, which means that you click over an ed2k link in a browser somewhere in the world and it gets into your home's aMule queue. It works by using aMuleCMD instead of using the ed2k command.

Linux

Instead of using the ed2k command, use the following as the command to use:

/path/to/amulecmd -h $server -P $pw -c "Add %u"

Obviously, you'll have to replace $server and $pw with your server's IP (or DNS) and your External Connections password.

NOTE: In Firefox, it is not possible to start a command with parameters. An easy solution is a shell script with the command described above. You only have to replace %u with $1. This shell script must be executable (chmod +x ed2k.sh) and defined as external ed2k app in Firefox.

Windows

Make sure aMule is installed with the aMuleCMD option checked.

We need a batch script to handle the ed2k links from the browser, and we need to add some keys to the registry to make the browser recognize the ed2k links. Things are different for 32 and 64 bit versions of Windows so pick the right section below. After you created the files and updated the registry, configure your browser if neccesary.

32 bit

Create a file named ed2k_remote.bat containing the following code:

@echo off
set link=%1
for /f "useback tokens=*" %%a in ('%link%') do set link=%%~a
"c:\Program Files\aMule\amulecmd.exe" /h server /P pass /c "add %link%"

Don't forget to replace server and pass with your data and save the file in your aMule directory C:\Program Files\aMule.

Create a file named ed2k_remote.reg containing the following code:

REGEDIT4

[HKEY_CLASSES_ROOT\ed2k]
@="URL: ed2k Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
@="C:\\Program Files\\aMule\\amulegui.exe"

[HKEY_CLASSES_ROOT\ed2k\shell]
@="open"

[HKEY_CLASSES_ROOT\ed2k\shell\open]

[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
@="\"C:\\Program Files\\aMule\\ed2k_remote.bat\" \"%1\""

Save the file and run it (double click) to add these keys to the registry.

64 bit

Create a file named ed2k_remote.bat containing the following code:

@echo off
set link=%1
for /f "useback tokens=*" %%a in ('%link%') do set link=%%~a
"c:\Program Files (x86)\aMule\amulecmd.exe" /h server /P pass /c "add %link%"

Don't forget to replace server and pass with your data and save the file in your aMule directory C:\Program Files (x86)\aMule.

Create a file named ed2k_remote_64.reg containing the following code:

REGEDIT4

[HKEY_CLASSES_ROOT\ed2k]
@="URL: ed2k Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ed2k\DefaultIcon]
@="C:\\Program Files (x86)\\aMule\\amulegui.exe"

[HKEY_CLASSES_ROOT\ed2k\shell]
@="open"

[HKEY_CLASSES_ROOT\ed2k\shell\open]

[HKEY_CLASSES_ROOT\ed2k\shell\open\command]
@="\"C:\\Program Files (x86)\\aMule\\ed2k_remote.bat\" \"%1\""

Save the file and run it (double click) to add these keys to the registry.

Internet Explorer

You should be OK with just the changes to the registry and the batch script in your aMule directory.

Safari

Safari will take over the settings in the registry, like Internet Explorer.

Chrome

Chrome will take over the settings in the registry. It asks for confirmation, so tick the "Don't ask me again" box.

Firefox

The first time you click an ed2k link in Firefox you will get the following dialog:

Firefox ed2k link.PNG

Tick the Remember box and click OK.

Opera

Open the preferences window and click the Programs tab

Opera preferences programs.PNG

Click the Add... button

Make Opera aware of the ed2k link protocol with these settings:

Opera protocols ed2k.PNG