Comments (8)
It does already have an API, although not really documented:
POST /torrents
with JSON like{"link":"magnet link or URL"}
- will add a new torrent
DELETE /torrents/{infoHash}
will delete the torrent- It will automatically start downloading when you request a file
GET /torrents
will return all torrents andGET /torrents/{infoHash}
one torrent- That would require downloading the files first (at least partially) and integrating with ffmpeg or some other external tool, and I'm not sure it's a good idea. Suggestions are welcome.
Do you have a particular scenario you would like to use the API in?
from peerflix-server.
From /torrents (POST, DELETE, GET) all works
Not enough GET /torrents/{infoHash}/stat - Information about running torrent Speed, Traffic, Peers, Queue. And working through WebSokket I do not like because of the limited SMART TV
- That would require downloading the files first (at least partially) and integrating with ffmpeg or some other external tool, and I'm not sure it's a good idea. Suggestions are welcome.
GET /torrents/{infoHash}/codec
This functionality is only active for distribution be used to display information about a file in the information section of a resolution, some ulcer 2.1 or 5.1, etc.
from peerflix-server.
Added the /stats endpoint and released as v0.0.19
https://github.com/asapach/peerflix-server/blob/master/REST.md
Will investigate ffmpeg next.
from peerflix-server.
Added support for ffmpeg in v0.0.20:
/torrents/{infoHash}/files/{path}?ffmpeg=probe
- will runffprobe
and dump the JSON output containing the format and streams information. Limitation:ffprobe
doesn't work with streams, so the file has to be at least partially downloaded, so that it could inspect the headers./torrents/{infoHash}/files/{path}?ffmpeg=remux
- will runffmpeg
and remux the file to MP4 - meaning the video stream will be copied and the audio stream will be converted to AAC (this should make it work in most browsers). Limitation: the video output doesn't support seeking, so you'll not be able to rewind.
To make it work you need to install ffmpeg: https://github.com/fluent-ffmpeg/node-fluent-ffmpeg#ffmpeg-and-ffprobe
On Windows you'll need to set FFMPEG_PATH
and FFPROBE_PATH
env variables (e.g. SET FFPROBE_PATH=C:\ffmpeg\bin\ffprobe.exe
On Ubuntu you'll need to install the package from the ppa:
sudo apt-add-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg
from peerflix-server.
@diaskooo, could you please try it out and provide some feedback?
from peerflix-server.
I'll try feature with converting to MP4, but is it possible to add ability for rewinding (перемотка) video ?
from peerflix-server.
In order to make seek/rewind work, the encoder needs to build the index that maps time to position (byte offset) in the file. For example 0:00:30
could map to offset 65536
in the stream. This allows the video player to jump directly to the requested position without having to make guesses or search the stream for timecodes. Unfortunately it's impossible to build the index on the fly: at least one full pass is required.
from peerflix-server.
Merging this thread into #19
from peerflix-server.
Related Issues (20)
- can't deploy the project HOT 1
- HTTP2 support HOT 16
- Built-in block list ? HOT 4
- TELEGRAM API HOT 4
- High RAM and CPU usage while torrents are idle? HOT 2
- Automatically resuming torrent HOT 2
- Download not completing HOT 3
- h
- upload functionality does not work HOT 2
- Sx
- Website is showing only a plain white screen. HOT 1
- Static Link? HOT 2
- heroku problem HOT 1
- previous state not found error in while launching peerflix-sever HOT 1
- No Web UI only REST api? HOT 3
- :9000 port does not working... HOT 4
- How to deploy it on IBM Cloud? HOT 1
- Deploying to another platform other than heroku.. HOT 1
- Unable to build docker image for arm machine HOT 1
- User / Client Panel register and login etc.....
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peerflix-server.