Giter Site home page Giter Site logo

snapxone / torrent-stream-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiralt/torrent-stream-server

0.0 0.0 0.0 12.96 MB

HTTP server to convert any torrent to video stream

License: MIT License

TypeScript 53.01% Dockerfile 0.11% HTML 0.43% CSS 0.89% JavaScript 0.06% SCSS 45.49%

torrent-stream-server's Introduction

Torrent Stream Server

Docker CodeQL Dependencies npm version

HTTP server to convert any torrent to stream with video support.

Cover

Features:

Setup

Deploy

Heroku forbids P2P services, so your account can be suspened (learn more)

NPM package

Read more

Other options

Documentation

API

API uses swagger.yaml to:

  1. To generate API documentation page, which can be accesed when using npm run dev on http://127.0.0.1:3000/api-docs.
  2. To generate frontend client (frontend/src/helpers/client)
  3. To generate backend models (src/models)

Check documentation

Examples

Open in VLC

Running the following commands from a shell will run VLC and start playing the Sintel movie stream from its public torrent:

By infohash (BTIH)

vlc "http://localhost:3000/stream/08ada5a7a6183aae1e09d831df6748d566095a10"

By magnet URI

vlc "http://localhost:3000/stream?torrent=magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&file=Sintel.mp4"

Download file using curl

This command will download Sintel movie from torrents and save as sintel.mp4.

curl "http://localhost:3000/stream/08ada5a7a6183aae1e09d831df6748d566095a10" > sintel.mp4

Security

API can be protected with security.apiKey, stream api can have additional JSON Web Token (configurable via security.streamApi.key).

If only only one key specified in the config, it will be used as both: API key & streamApi.key.

API protection

When api or stream key is enabled, each API call will require Authorization header:

Authorization: Bearer <token>

Generate stream API URL

import { sign } from 'jsonwebtoken'

const url = `/stream/${encodeURIComponent(
    sign(
        {
            torrent: '08ada5a7a6183aae1e09d831df6748d566095a10',
            fileType: 'video',
        },
        key
    )
)}`

This API will have encoded parameters, so it's safe to share it publicly. It will automatically expire (configurable via security.streamApi.maxAge)

torrent-stream-server's People

Contributors

dependabot[bot] avatar kiralt avatar pataquets avatar

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.