Skip to content

billyprice1old/Mega-Torrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mega-Torrent

build-badge

Installation

npm install mega-torrent

var Mega_Torrent = require('mega-torrent')

API

Main Module

var mega_t = new Mega_Torrent([options])

Create new torrent downloader.

Supporter options:

email - User login email (Require)
password - User password (Require)

mega_t.download(Torrent)

Start downloading a torrent.

Torrent can be:

• magnet uri (string)
• torrent file (buffer)
• info hash (hex string or buffer)
• parsed torrent (from parse-torrent)
• http/https url to a torrent file (string)
• filesystem path to a torrent file (string)

mega_t.getStatus()

Return the current status of the Mega_Torrent instance.

Code:

• 0 - Doing nothing
• 1 - Downloading the Torrent
• 2 - Uploading the Torrent

mega_t.getMegas()

Return running uploading instances. (aka megas)

mega_t.getClients()

Return running downloading instances. (aka clients)

Megas

Instance of current uploading file to MEGA.

megas.getStream()

Return Node stream instance.

megas.getProgress()

Return the current upload percentage. (between 0 and 1)

megas.getFile()

Return Node fs stats instance.

Clients

Instance of downloading torrent client.

clients.stop()

Stop and destroy the current downloading torrent.

clients.getProgress()

Return the current download percentage. (between 0 and 1)

clients.getTorrent()

Return WebTorrent torrent instance.

About

Download torrent directly to your mega account

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published