Download via OpenFT

Download books with OpenFT (Open FastTrack).

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

Advertisement:

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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");
})();