Skip to main content

eD2K links

An eD2K link names a file of the eD2K network, or a server, a list of servers or a list of Kad nodes, in one line of text that starts with ed2k://. Web pages and other people share files this way: a file link holds the file's name, size and hash, which is all njMule needs to download it from whoever has it. This page lists the kinds of links, the ways to add them, and how to let njMule open the links you click in a browser.

LinkLooks likeWhat njMule does with it
Fileed2k://|file|name|size|hash|/Adds a download of the file.
Servered2k://|server|host|port|/Adds the server to your server list.
Server listed2k://|serverlist|https://…/server.met|/Downloads the server.met and adds its servers.
Nodes listed2k://|nodeslist|https://…/nodes.dat|/Downloads the nodes.dat and adds its Kad contacts.
Searched2k://|search|words|/Understood, but not acted upon yet.
Magnetmagnet:?xt=urn:ed2k:hash&xl=size&dn=nameThe eD2K form of a magnet link: adds a download, as a file link does.

A file link may carry more after its hash, which njMule uses when it is there:

  • h= the file's AICH hash, which lets njMule check and repair its parts;
  • p= the hashes of its parts;
  • s= a web address the file can also be downloaded from (http or https only);
  • after the closing /, a list of sources: |sources,198.51.100.7:4662,…|/, at most 32,767 of them; a list dated with @ and a date (|sources@261231,…|/) is left out from that date on.

A file may be up to 256 GiB. Links whose separators a browser escaped (%7C for |) are read too. A magnet link is taken only in its eD2K form (urn:ed2k: or urn:ed2khash:, with a name and a size); the magnet links of BitTorrent stay with the programs made for them.

There are several ways to add eD2K file links as downloads:

WayHow
Add linksIn Transfers, press Add links and paste the links: see below.
Pasting in TransfersPress Ctrl+V on the Transfers screen, outside its fields: the links go into the category shown.
The command palettePress Ctrl+K, paste the links and choose Download: ….
Drag and dropDrag links from a web page or a text onto the njMule window.
A browserClick a link, once njMule opens ed2k links: see Opening links from a browser.
The command linenjmule-gui "ed2k://|file|…|/": see The command line.
The clipboardCopy links anywhere, while the desktop app watches the clipboard: see Watching the clipboard.

Pasting in Transfers, the palette and drag and drop find every file link in the text, apart by spaces or lines: ed2k://|file| links, escaped or not, and the magnet links of eD2K files. Each becomes a download; the clipboard is watched for a text that starts with such a link. Each download goes into the first category whose names it matches (see Categories), and starts paused when Add files to download in paused mode is on in Directories. A message names each one added (Download added: …). Adding the link of a file you already download only adds its sources to the download.

The Add downloads dialog​

Add links opens Add downloads, a dialog that shows the files before they are added. Links on the clipboard are already in it.

The Add downloads dialog: a box with two eD2K links and a Paste button, Files found: 2 with both files ticked and their sizes, the Category By the rules of the categories, the box Add files to download in paused mode, the total 2 · 10.39 GB, and the buttons Download and CancelThe Add downloads dialog: a box with two eD2K links and a Paste button, Files found: 2 with both files ticked and their sizes, the Category By the rules of the categories, the box Add files to download in paused mode, the total 2 · 10.39 GB, and the buttons Download and Cancel
Two links pasted in Add downloads
  1. Type or paste the links in eD2K links, one per line; Paste adds what is on the clipboard after what is there. Links inside other text, such as a page's text or its HTML, are found too.
  2. Under Files found: … every file appears once, with its size and what njMule knows of it already: Already downloading or Shared. Untick the files you do not want: those you download or share already start unticked.
  3. Choose the Category: By the rules of the categories (the default unless Transfers shows one category), (Unassign), or one of your categories.
  4. Tick Add files to download in paused mode to add them paused. It starts ticked when the option of Directories is on, and what you choose here wins over it.
  5. The line at the bottom counts the files and their total size. Press Download.

Download stays off while no file is ticked. The box takes file links only, escaped and magnet ones too, wherever they are in the text.

When njMule opens ed2k links, a click on a link in a browser (or another program) hands it to njMule: a file link becomes a download, a server link adds the server, and server and nodes lists are downloaded. If njMule is not running, it starts with the link. On Windows and Linux njMule takes the links only when you ask it to (off by default), and gives them back when you ask again.

  1. Open Options → General.
  2. Under Miscellaneous, turn on Open ed2k links with njMule (from browsers and other programs).

njMule then registers its desktop program, njmule-gui.exe, as the handler of ed2k links for your user only. What opened them before, such as eMule, is saved first (in ed2k-handler-backup.reg, in njMule's configuration folder), and turning the option off gives the links back to it.

Uninstalling njMule gives the links back by itself (an upgrade keeps them).

The option works only in the installed desktop app on njMule's computer, on Windows and Linux: it is greyed out on macOS, in a development build, in the web interface and in a window on a remote njMule. If changing the handler fails, njMule says Cannot change which program opens ed2k links: … and the switch shows the real state again.

njmule --restore-links gives the ed2k links back to what opened them before njMule took them, if njMule still has them, then exits. It tells what it did: ed2k links given back., ed2k links open in another program: left as they are., or that this program does not open ed2k links here. The Windows uninstaller runs it for you.

njmule --restore-links

The command line​

Links given to the desktop app on the command line are handled as a click in a browser, and so are the magnet links of eD2K files, as the njmule command line takes them. Quote each link, as the | and & in it mean something to the shells:

njmule-gui "ed2k://|file|Example.iso|734003200|0123456789ABCDEF0123456789ABCDEF|/"
njmule-gui "magnet:?xt=urn:ed2k:0123456789ABCDEF0123456789ABCDEF&xl=734003200&dn=Example.iso"

If the desktop app already runs, the links go to it, its window comes to the front, and the new start ends at once. Started without links, a second start only brings the running window to the front. When njMule runs without a window on the same profile, such as njmule in a terminal, the links go to it and the desktop app says so instead of opening. Words that are not eD2K or magnet links are left out, and a magnet link of another network adds nothing. For the other options of the command line, see Command line.

Watching the clipboard​

The desktop app can notice eD2K file links you copy in other programs. Turn on Watch clipboard for eD2K file links in General options (off by default; greyed out in the web interface). Then:

  1. Copy a text that starts with an eD2K file link, escaped or not, or with the magnet link of an eD2K file, in a browser or elsewhere.
  2. njMule asks Add these eD2K file links to download?, naming the files (up to ten).
  3. Press Download to add them, or Leave them.

While the option is off, njMule never reads the clipboard. Only what you copy after turning it on counts, and the links njMule copies itself are left alone.

Every list of files copies their links, one per line, to give to others:

  • Copy eD2K link in Transfers (also Ctrl+C), Search and Shared files.
  • Copy eD2K Links (HTML) copies them as HTML links for a web page, as <a href="ed2k://|file|…|/">name</a>.
  • Copy eD2K Links in the server list copies server links.