Download via OpenFT

Download books with OpenFT (Open FastTrack).

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name        Download via OpenFT
// @description Download books with OpenFT (Open FastTrack).
// @author      Schimon Jehudah, Adv.
// @namespace   i2p.schimon.menu-download-openft
// @homepageURL https://greasyfork.org/scripts/521451-openft-book-library
// @supportURL  https://greasyfork.org/scripts/521451-openft-book-library/feedback
// @copyright   2025, Schimon Jehudah (http://schimon.i2p)
// @license     MIT; https://opensource.org/licenses/MIT
// @match       *://*.annas-archive.io/md5/*
// @match       *://*.annas-archive.li/md5/*
// @match       *://*.annas-archive.org/md5/*
// @match       *://*.annas-archive.pk/md5/*
// @match       *://*.annas-archive.se/md5/*
// @match       *://annas-archive.io/md5/*
// @match       *://annas-archive.li/md5/*
// @match       *://annas-archive.org/md5/*
// @match       *://annas-archive.pk/md5/*
// @match       *://annas-archive.se/md5/*
// @match       *://libgen.bz/*
// @match       *://libgen.gs/*
// @match       *://libgen.io/*
// @match       *://libgen.la/*
// @match       *://libgen.li/*
// @match       *://libgen.org/*
// @match       *://libgen.vg/*
// @version     26.04.18
// @run-at      context-menu
// @icon        data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7ihpTvuI88L3RleHQ+PC9zdmc+Cg==
// ==/UserScript==

(function downloadViaEd2k() {
  // Properties
  let bookMd5sum, bookUri, bookSize, bookTitle;
  if (location.search.startsWith('?md5=')) {
    let url = new URL (location.href);
    bookMd5sum = url.searchParams.get('md5');
    bookTitle = 'Book ' + document.evaluate('/html/body/table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[2]/text()[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.textContent;
  } else {
    bookTitle = 'Book ' + document.title;
    bookMd5sum = document.documentURI.split('/')[4];
  }
  //bookFormat = 
  bookSize = 1; // TODO Extract MB and convert to bytes: mb * 1024 * 1024
  //window.open(`ed2k://|file|${bookTitle}|${bookSize}|${bookMd4sum}|/`, "_self");
  window.open(`magnet:?dn=${bookTitle}&xt=urn:md5:${bookMd5sum}&xt=urn:ed2khash:${bookMd5sum}&xl=${bookSize}`, "_self");
})();