Giter VIP home page Giter VIP logo

magnet-link's Introduction

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

magnet-link's People

Contributors

ungoldman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

magnet-link's Issues

Error: Torrent is missing required field: info

magnet-link https://1337x.to/torrent/4791636/Dolphin-Island-2021-HDRip-XviD-AC3-EVO-TGx/#

Torrent is missing required field: info Error: Torrent is missing required field: info
	at ensure (/usr/local/lib/node_modules/magnet-link/node_modules/parse-torrent-file/index.js:144:20)
	at decodeTorrentFile (/usr/local/lib/node_modules/magnet-link/node_modules/parse-torrent-file/index.js:20:3)
	at parseTorrent (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/node_modules/parse-torrent/index.js:22:12)
	at onData (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/index.js:25:26)
	at Request.onResponse [as _callback] (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/index.js:47:9)
	at Request.self.callback (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:185:22)
	at Request.emit (events.js:315:20)
	at Request.<anonymous> (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:1154:10)
	at Request.emit (events.js:315:20)
	at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:1076:12)

Torrent is missing required field: info

magnet-link https://1337x.to/torrent/4791636/Dolphin-Island-2021-HDRip-XviD-AC3-EVO-TGx/#

Torrent is missing required field: info Error: Torrent is missing required field: info
	at ensure (/usr/local/lib/node_modules/magnet-link/node_modules/parse-torrent-file/index.js:144:20)
	at decodeTorrentFile (/usr/local/lib/node_modules/magnet-link/node_modules/parse-torrent-file/index.js:20:3)
	at parseTorrent (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/node_modules/parse-torrent/index.js:22:12)
	at onData (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/index.js:25:26)
	at Request.onResponse [as _callback] (/usr/local/lib/node_modules/magnet-link/node_modules/read-torrent/index.js:47:9)
	at Request.self.callback (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:185:22)
	at Request.emit (events.js:315:20)
	at Request.<anonymous> (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:1154:10)
	at Request.emit (events.js:315:20)
	at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/magnet-link/node_modules/request/request.js:1076:12)

How can I get the missing info?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.