GitXplorerGitXplorer
u

magnet-link

public
63 stars
8 forks
0 issues

Commits

List of commits on branch master.
Verified
f2d961aec3bbff562091c359ba91e1e5e99629c5

Update README.md

uungoldman committed 4 years ago
Unverified
2a3cf0bb8c423c414d196212e1bed8bf8e1397bf

1.1.3

uungoldman committed 7 years ago
Unverified
473dde366e4d19124a5963d8fed7bfa2dc64502d

fix(deps): remove dumb typo

uungoldman committed 7 years ago
Unverified
7bfa0d08abb1bf173fd75bc8fa791d85588849e3

1.1.2

uungoldman committed 7 years ago
Unverified
d36dca806925dbf8fc2ce935cf894563d6fcf733

docs: update readme

uungoldman committed 7 years ago
Unverified
693f73ac71d2702aed77aaa9e41e62b5193ae140

docs: update license

uungoldman committed 7 years ago

README

The README file for this repository.

magnet-link

DEPRECATED: this project is no longer maintained

Get a magnet link from a torrent file.

npm travis standard downloads

Read more about the magnet URI scheme at the magnet-uri project website.

Install

npm install magnet-link

Usage

Node

var magnetLink = require('magnet-link')

magnetLink('http://my-server.com/file.torrent', function (err, link) {
  if (err) throw err
  console.log(link)
  // you got a magnet link from a remote torrent file
})

magnetLink('mydir/file.torrent', function (err, link) {
  if (err) throw err
  console.log(link)
  // you got a magnet link from a local torrent file
})

The result is a string that looks like this.

magnet:?xt=urn:btih:[torrent-info-hash]

CLI

There is also a command-line interface available if you install it with -g.

npm install -g magnet-link

This installs a program called magnet-link that you simply pass a torrent file or url.

magnet-link http://my-server.com/file.torrent

This will print the magnet link to the terminal.

Pipes

You can also pipe the contents of a torrent file to magnet-link:

cat file.torrent | magnet-link
magnet-link < file.torrent

This way it can be paired with create-torrent:

create-torrent . | magnet-link

Contributing

Contributions welcome! Please read the contributing guidelines before getting started.

License

ISC