Giter Club home page Giter Club logo

node-torrent-cloud's Introduction

The first release of version 2 is ready!

⚠️ This version is deprecated. If you'd like to be the maintainer or contributer of this version, please leave a comment here.


Torrent Cloud

A torrent client in the cloud, written in Node.js

There are a various existing cloud torrent services (bitport.io, btcloud.io, put.io), though they're all subscription-based or have limits imposed. Torrent Cloud is intended to be self-hosted on your own cloud compute combined with your own cloud storage. When a file is downloaded, Torrent Cloud simultaneously downloads and uploads the file, so when a torrent is complete, you'll find it in your own storage.

screenshot

Disclaimer This project was created to bring about an addition download channel to defeat unfair BitTorrent protocol restrictions imposed by enterprises and ISPs. It was intended for downloading legal, non-copywrite material, such as: public linux distributions, personal files, large public statistical datasets, public domain images and videos from archive.org, etc. This project will not take any responsibility for any illegal use, by using this software you agree to these terms.

Features

  • Embedded torrent search
  • Load torrents via magnet URI or torrent file URL
  • Magnet URI editor
  • Responsive WebUI (Mobile friendly)
  • Download all as streaming ZIP file
  • Uses high-bandwidth upload download of cloud providers

Installation

  1. Collect the environment variables

    1. Setup your cloud storage (Choose one)

      • AWS

        1. Sign up for a free for 1 year Amazon Web Services account
        2. Go to the AWS Console
        3. Retrieve your API keys (Top-right menu [Your Name] > Security Credentials)
        4. Create an S3 bucket in the region closest to you
        5. You'll need your AWS Access key (AWS_ACCESS_KEY Required)
        6. You'll need your AWS Secret key (AWS_SECRET_KEY Required)
        7. You'll need the S3 bucket name (AWS_BUCKET Required)
        8. You'll need the S3 bucket region code (AWS_REGION Required see region codes)
      • Mega Warning: the Mega backend is quite buggy

        1. Sign up for a free Mega account
        2. You'll need your username (email address) (MEGA_EMAIL Required)
        3. You'll need your password (MEGA_PASSRequired)

      Note: See the contribute section for adding more storage backends

    2. Consider these optional variables

      1. HOST Listening interface (Optional defaults to all 0.0.0.0)
      2. PORT Listening port (Optional default 3000)
      3. AUTH_USER HTTP Basic Auth (Optional default admin)
      4. AUTH_PASSWORD HTTP Basic Auth (Optional if set HTTP auth will be enabled)
      5. SEARCH_PROVIDERS_URL URL to a JSON configuration file (Optional see below)
  2. Choose a cloud hosting environment

    1. Heroku

      1. Sign up for a free Heroku account

      2. Click this Deploy button and fill in the variables you've considered above

        Deploy

    2. Others

      1. Install Node
      2. $ npm i -g torrent-cloud
      3. env PORT=8080 torrent-cloud
  3. And that's it! (On Heroku, visit https://<appname>.herokuapp.com)

You can change these via the Heroku command-line tool or in the Heroku dashboard Apps > App > Config Variables > Reveal > Edit.

Search Providers

Torrent Cloud provides an easy way to screen-scrape any of the copyright-free (legal) torrent sites. The search provider specification can be found here: https://gist.github.com/jpillora/e667f3d16a6bd403edc4. Please add your custom providers in the comment section.

Contributing

Backend A Node.js app using Express, WebSockets, and many other modules. The server entry point is server.js and the modules are inside lib/, they're documented in the comments though questions are welcome via Issues. Currently there are only Mega and AWS storage backends, though contributions are wanted. To get started, take a look at lib/backends/_template.js for the required interface.

Frontend An Angular app with related all files in static/. The HTTP API is for initiating all actions (e.g. start/stop torrent), and will return an error or an empty OK. The entire app state is sent, on change, via WebSockets.

Help!

  • Q. If deployment succeeds but the page isn't loading?
  • A. View torrent-cloud's stdout. On Heroku, you can view logs with: heroku logs --tail --<appname> (heroku tool required). You're most likely missing one of storage environment variables above.
  • Q. Download speed goes up then down?
  • A. There is a 50MB buffer, so once the download goes 50MB past the upload, it will stop and wait for the upload to catch up.
  • Q. Why is the Mega backend is buggy?
  • A. It uses an old library and it hasn't been tested as much as the AWS backend.
  • Q. Heroku dynos turn Idle after 30 minutes of no requests?
  • A. Use https://uptimerobot.com/ to ping it, you also get the added benefit of tracking its uptime

Ask questions on the Issues page.

Known Issues

  • Only supports modern browsers
  • Heroku restarts free dynos every day, so your open torrents will be closed once a day. This will also occur every time your app "idles", which can be prevented with a periodic ping, from a service like Uptime Robot, etc. This makes it impossible to download slow torrents over a long period of time.

Todo

  • Config file
    • Reconfigurable in UI
  • Mega streaming media
  • More search providers
  • More storage backends
  • More hosting providers
    • Nodejitsu
    • Openshift (Tested though torrent's seem to be unable to connect to the swarm)
  • Use backend storage to keep app state between restarts
  • Improve UI
    • Make use of screen real estate with mobile in mind
    • Drop-in torrent files
    • Improved file management
      • Save as
      • Rename
      • Folder management
        • Folder UI
  • Better download previewers
    • Add Flash fallback for MP3s in Chrome
  • Port to Go using anacrolix/torrent

Credits

Built around @mafintosh's awesome torrent-stream.

MIT License

Copyright © 2015 Jaime Pillora <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

node-torrent-cloud's People

Contributors

jpillora avatar rakshans1 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-torrent-cloud's Issues

upload file to any server apart from aws and mega

hello sir,
please i need some little help i want to know how i can download files to my own server apart from aws , mega and heroku, I wanted all files to be downloaded on a single server please how do i do this

Start a nodejs script on download complete

I am a nodejs developer and have created a simple interface to upload downloaded files to Google Drive.
But I can't find where to place code in your golang scripts to start mine, please tell me which file needs to be edited for this.

correct proxy_pass for nginx

it seems to work with the below settings: (some of them may be redundant/not applicable)

    location /api/ { 
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            proxy_set_header X-Real-IP       $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_pass_header Server;
            proxy_set_header Host $host;
            proxy_buffering off;
            proxy_pass http://nodetorrent:8080/api/;
    }

    location / {
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_pass_header Server;
        proxy_set_header Host $host;
        proxy_buffering off;
           proxy_pass http://nodetorrent:8080/;
}

No backend match. Environment variables missing for: aws.js, mega.js

After I deploy the current master at Heroku free Dyno, App page shows this:
Application Error An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.

And this is the output of heroku logs:
2016-05-05T01:18:00.616224+00:00 heroku[api]: Release v2 created by [email protected] 2016-05-05T01:18:00.616224+00:00 heroku[api]: Enable Logplex by [email protected] 2016-05-05T01:19:24.496990+00:00 heroku[api]: Deploy 35c516f by [email protected] 2016-05-05T01:19:24.496990+00:00 heroku[api]: Release v3 created by [email protected] 2016-05-05T01:19:24.496245+00:00 heroku[api]: Scale to web=1 by [email protected] 2016-05-05T01:19:24.962341+00:00 heroku[slug-compiler]: Slug compilation started 2016-05-05T01:19:24.962346+00:00 heroku[slug-compiler]: Slug compilation finished 2016-05-05T01:19:26.916202+00:00 heroku[web.1]: Starting process with commandnode server.js 2016-05-05T01:19:30.554267+00:00 app[web.1]: No backend match. Environment variables missing for: aws.js, mega.js 2016-05-05T01:19:31.638131+00:00 heroku[web.1]: State changed from starting to crashed 2016-05-05T01:19:31.639385+00:00 heroku[web.1]: State changed from crashed to starting 2016-05-05T01:19:31.630398+00:00 heroku[web.1]: Process exited with status 1 2016-05-05T01:19:33.047734+00:00 heroku[web.1]: Starting process with commandnode server.js2016-05-05T01:19:35.259335+00:00 app[web.1]: No backend match. Environment variables missing for: aws.js, mega.js 2016-05-05T01:19:35.968360+00:00 heroku[web.1]: Process exited with status 1 2016-05-05T01:19:35.948261+00:00 heroku[web.1]: State changed from starting to crashed 2016-05-05T01:20:02.174098+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=powerful-woodland-25592.herokuapp.com request_id=d74de48d-8a97-4fc1-b056-c3f806ed09f3 fwd="203.110.242.20" dyno= connect= service= status=503 bytes= 2016-05-05T01:20:03.829016+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-woodland-25592.herokuapp.com request_id=1a1d3e25-3b7e-45ff-aed5-58a050ebaa06 fwd="203.110.242.20" dyno= connect= service= status=503 bytes= 2016-05-05T01:20:04.873119+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=powerful-woodland-25592.herokuapp.com request_id=2c04d26b-95c0-43fa-9f3f-61fe97f0f478 fwd="203.110.242.20" dyno= connect= service= status=503 bytes=
How to solve this?

node server.js

please fix the error below

npm start
(node:792) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

[email protected] start /home/cabox/workspace
node server.js

module.js:471
throw err;
^

Error: Cannot find module 'request'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/cabox/workspace/lib/searchers/screen-scraper.js:2:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

npm ERR! Linux 2.6.32-042stab112.15
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "start"
npm ERR! node v6.11.2
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! This is most likely a problem with the torrent-cloud package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get their info via:
npm ERR! npm owner ls torrent-cloud
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/cabox/workspace/npm-debug.log

please check this error

Azure Web App problem

When I try to run this project locally and on heroku it runs perfectly fine but when I deploy it on Azure the Websocket connection keeps connecting and disconnecting in a matter of milli-seconds. I have turned the WebSockets support on. Do you have any ideas?

App Crashed on heroku/vps

Error is posted

internal/buffer.js:77
  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 6. Received 8
    at boundsError (internal/buffer.js:77:9)
    at Buffer.readInt32BE (internal/buffer.js:473:5)
    at Object.exports.prepareKey (/usr/lib/node_modules/torrent-cloud/node_modules/mega/lib/crypto/index.js:35:24)
    at new Storage (/usr/lib/node_modules/torrent-cloud/node_modules/mega/lib/storage.js:75:21)
    at mega (/usr/lib/node_modules/torrent-cloud/node_modules/mega/lib/mega.js:9:10)
    at Object.exports.init (/usr/lib/node_modules/torrent-cloud/lib/backends/mega.js:12:13)
    at /usr/lib/node_modules/torrent-cloud/lib/backend.js:51:10
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/usr/lib/node_modules/torrent-cloud/lib/backend.js:21:10)
    at Module._compile (internal/modules/cjs/loader.js:1123:30) {
  code: 'ERR_OUT_OF_RANGE'
}

Getting an error in backend.js while deploying it on heroku

Below is the error observed in the logs

2016-10-01T09:38:24.791201+00:00 app[web.1]: at Module._compile (module.js:387:25)

2016-10-01T09:38:24.791208+00:00 app[web.1]: at Object.Module._extensions..js (module.js:422:10)

2016-10-01T09:38:24.791208+00:00 app[web.1]: at Module.load (module.js:357:32)

2016-10-01T09:38:24.791209+00:00 app[web.1]: at Function.Module._load (module.js:314:12)

2016-10-01T09:38:24.791209+00:00 app[web.1]: at Module.require (module.js:367:17)

2016-10-01T09:38:24.791210+00:00 app[web.1]: at require (internal/module.js:20:19)

2016-10-01T09:38:24.791210+00:00 app[web.1]: at /app/lib/backend.js:26:16

2016-10-01T09:38:24.791210+00:00 app[web.1]: at Array.forEach (native)

2016-10-01T09:38:24.791214+00:00 app[web.1]: at Object. (/app/lib/backend.js:21:10)

2016-10-01T09:38:32.818604+00:00 heroku[web.1]: State changed from crashed to down
1.txt

Looking for contributors

Those who are interested, please send your PR with your fixes and features, I'll review and make you a collaborator on this project

Heroku is deleting my app

Hello,

I did all the mentioned things in the info and added Mega Email and password while deploying in Heroku and I also provided Auth Username and password, but after the successful build, heroku immediately deleted my app.

Please help me and why heroku is doing this?

app is not working

An error occurred in the application and your page could not be served. Please try again in a few moments.

If you are the application owner, check your logs for details.

Download gets stuck and doesnt respond

hey,
i've been using torrent-cloud for a few days now and i must admire what you have done. It is a very cool thing. i have been encountering an issue lately that while downloading a torrent the downloading speed reduces to zero b/s and after that it doesnt resume or increase the speed, it sort of freezes. Is there any way to mitigate this nuisance?

A small question

Why did they abandon the use of NodeJS by the implementation in "Go Lang"?

I find the answer interesting, had some inconvenience, or Go presented some advantage when compiled?

Add support for Docker

Can you plz add support for Docker file just like you did for Cloud-Torrent?
Thx in advance

backend: local ?

first, cool project.

second, i dont know node otherwise i'd be doing this myself (tried to, actually) but is there a way to just have local storage without a backend? i used the _template.js example to create a local.js that just does nada but for some reason it hangs after i try to load a torrent

not sure if thats a bug in something else, as even without my changes i couldn't get torrent-cloud to load a torrent and download successfully using the mega backend..

i guess it could be a port-forwarding issue as i'm using it inside of a lxc container on an ubuntu 14.04 vps

(a local or ftp backend would be tits)

Loaded torrents disappear after restarting container

In the log of cloud-torrent inside the container I see:

/ # cloud-torrent -l 2018/06/06 17:05:37 Loaded new search providers 2018/06/06 17:05:38 couldn't open piece completion db in "/downloads": timeout 2018/06/06 17:05:38 initial configure failed: listen tcp 0.0.0.0:50007: bind: address already in use

Please help me, I wanna use this as my main torrent downloader.

Thanks a lot.

No such app

Dear,

I have follow as your guide and run your script. But I have got a problem there is No such app on my web page. My web page is here.

Please help me to fix and mention where I am wrong?

Best,
Sai Tawng Pha

get this error while trying to run on window 7

please i need help on how to run this app on window i have install node and npm but i get this error please help me on how to fix it.

C:\Users\Buziyborni\Desktop\ability\node-torrent-cloud>node server.js
No backend match. Environment variables missing for: aws.js, mega.js

C:\Users\Buziyborni\Desktop\ability\node-torrent-cloud>

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.