Ed2k links handling-nl

From AMule Project FAQ
Revision as of 10:17, 15 August 2006 by EagleF (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
English | Deutsch | Nederlands

Hoe je aMule je ed2k links laat afhandelen via ja favoriete WebBrosers is afhankelijk van de WebBrowser die je gebruikt. Hier is een lijst met mini-HowTo's voor elk van de populairste WebBrowsers. Bedenk dat overal in dit document /path/to/ed2k vervangen moet worden door /usr/local/bin/ed2k, /usr/bin/ed2k, C:\Program Files\aMule\ed2k.exe of wat dan ook, afhankelijk van de configuratie van jouw systeem.

In het algemeen, op de meeste Linux systemen, installeren zelf-gecompileerde aMules de ed2k utility in /usr/local/bin/ed2k, terwijl pakket-geinstalleerde aMules het in /usr/bin/ed2k installeren. Als een uitzondering, het is bekend dat SuSE pakketten installeert in /usr/local/bin/ed2k.

Internet Explorer

door Jacobo221

Ga naar "Start" -> "Uitvoeren" en start "regedit" (zonder aanhalingstekens).

Nu, in regedit, ga naar HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ed2k\shell\open\command

LET OP: Het is mogelijk dat ed2k en/of zijn submappen niet bestaan. In zo'n geval, maak ze een voor een aan door te kiezen voor "Nieuw" -> "Sleutel" en ed2k of wat dan ook in te vullen als waarde.

http://www.amule.org/dev-up/ed2k-win1.jpg

Klik nu dubbel op "(Default)" (of "(Standard)" of wat de eerste waarde daar is) en voer het pad naar de ed2k applicatie, gevolgd door "%1" (met aanhalingstekens), in. Je moet dus eindigen met een waarde als C:\Program Files\aMule2\ed2k "%1".

http://www.amule.org/dev-up/ed2k-win2.jpg

Doe tenslotte het zelfde in HKEY_CLASSES_ROOT\ed2k\shell\open\command

Konqueror

door gfdsa

Om ed2k links te laten werken vanuit Konqueror moet je een protocol-bestand toevoegen aan de directory met de andere protocol-bestanden. Deze directory kan je vinden door te zoeken naar bestandsnamen die eindigen op .protocol. Om te zoeken draai `find /usr/-name "*.protocol"` of `find /opt -name "*.protocol"`. Als je niet zeker weet in welke directory KDE is geinstalleerd kan je / gebruiken als zoekpad.

Als het zoeken succesvol is geweest, maak een bestand als ed2k.protocol aan de gevonden 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

Herstart nu Konqueror.

LET OP: Het is mogelijk dat je een beveiligingswaarschuwing krijgt. Maak je geen zorgen, het is slechts een waarschuwing dat de link naar een externe applicatie wordt gestuurd.

LET OP2: Als de link na het klikken op OK in de beveiligingswaarschuwing nog steeds niet naar aMule wordt gestuurd, klik dan met de rechtermuisknop op de ed2k link en vertel Konqueror om het te openen in een nieuw venster/tab.

Galeon

Methode 1

In het GNOME Control Center ga naar "Complex" -> "File Types and Programs" -> "Internet Services" -> "Add Service...".

Voer ed2k in in het Protocol veld.

Voer ed2k "%s" in in het Programma veld.

Deselecteer "Run in terminal" als dat geselecteerd is.

Klik op OK en je bent klaar!

Methode 2

Voer de volgende drie commando's uit om de juiste gconf sleutels aan te laten maken:

  • gconftool-2 -t string -s /desktop/gnome/url-handlers/ed2k/command "/usr/local/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

Vervang "/usr/local/bin/ed2k" hierboven met het pad en de naam van de ed2k applicatie op jouw systeem.

Deze protocol afhandelaar deinstalleren is net zo simpel:

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

Opera

door thermoman (Marcel Meckel), ender en Jacobo221

Nette manier

In Opera ga naar Tools->Preferences->Paths and Programms->Add...

Voer ed2k in in het "Protocol" veld.

Voer /path/to/ed2k in in het "Path" of "Open with another application" veld .

http://www.amule.org/dev-up/ed2k-op.jpg

Smerige manier

Als de bovenstaande instructies niet werken, kunt u proberen om /etc/opera6rc als root te bewerken of ~/.opera/opera6.ini als niet-root. Stel dan in:

[User Prefs]
TrustedExternalURLProtocols=ed2k
[Trusted Applications]
ed2k=ed2k

Opera 6 bug

Opera 6 geeft niet de complete URL door aan externe programa's; alleen URLs zonder protocol. Hierna volgt de manier om dit te omzeilen.

Linux of een andere soort Unix-achtige

Maak amule_submit.sh met dit als inhoud aan:

#!/bin/sh
/path/to/ed2k "ed2k://$1"

Verander nu in Tools->Preferences->Paths and Programms->Add...->Path of in het opera6rc bestand ed2k=/path/to/ed2k door ed2k=/path/to/amule_submit.sh

Windows

Maak amule_submit.bat met dit als inhoud aan:

X:\path\to\ed2k.exe "ed2k://%1"


Verander ed2k=/path/to/ed2k ed2k://%u door ed2k=X:\path\to\amule_submit.bat ed2k://%u

Mozilla 1.7 (or later) & Firefox 0.9 (or later)

by GhePeU

Mozex doesn't work anymore with Mozilla 1.7 and Firefox 0.9. There is an alternate method that seems to be working with both of them:

  • Remove MozEx if installed or at least remove the ed2k input from it (only if MozEx is installed)
  • 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.

http://www.amule.org/dev-up/ed2k-ff9.jpg

NOTE 1: Since version 1.5.x of Mozilla Firefox this method doesn't work any longer for the windows version. You must use the Internet Explorer method with the registry entries instead.


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.

Remotely handling 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.

How?

Easy enough: using aMuleCMD (thanks djtm for this tip). Instead of using the ed2k command, use the following as the command to use:

/path/to/amulecmd -rh $server -pw $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.

Please note that the above tip is only available since aMule 2.0.0rc8.

NOTE 1: 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.

NOTE 2: If you prefer simple tools, try this shell script (for Linux) - can be used with the above mentioned tip:

#!/bin/bash
beep -f 100 -l 40 -r2
(sleep 1; echo dllink $1; sleep 2; echo q;) | nc IP PORT
beep -l 15 -r3

nc is Netcat, but you can use telnet too (that's a bit simpler in Cygwin), beep is a simple program for beeping. IP and PORT should be replaced with the IP address and port of your remote server. That's it.

      • N O T E***

I found the perfect way to do this.

To make FireFox launch ed2k links correctly (in aMule) you have to follow some simple steps to tell it how to handle a new external protocol. This should get rid of the dreaded "ed2k is not a registered protocol" error you were most likely getting before.

  • Enter about:config in the address bar.
  • Right click on the list, select New, then Boolean; enter
 network.protocol-handler.external.ed2k as Preference Name and true as Value
  • Now right click, select New and String; enter

network.protocol-handler.app.ed2k as Preference Name and /usr/bin/ed2k