mirror of
https://github.com/asapach/peerflix-server.git
synced 2026-04-25 14:45:50 +03:00
[GH-ISSUE #20] Add RESTful API #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @diaskooo on GitHub (Jan 22, 2015).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/20
Add to peerflix-server support RESTful API be able to manage removed peerflix-server
@asapach commented on GitHub (Jan 22, 2015):
It does already have an API, although not really documented:
POST /torrentswith JSON like{"link":"magnet link or URL"}- will add a new torrentDELETE /torrents/{infoHash}will delete the torrentGET /torrentswill return all torrents andGET /torrents/{infoHash}one torrentDo you have a particular scenario you would like to use the API in?
@diaskooo commented on GitHub (Jan 23, 2015):
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
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.
@asapach commented on GitHub (Jan 24, 2015):
Added the /stats endpoint and released as v0.0.19
https://github.com/asapach/peerflix-server/blob/master/REST.md
Will investigate ffmpeg next.
@asapach commented on GitHub (Jan 24, 2015):
Added support for ffmpeg in v0.0.20:
/torrents/{infoHash}/files/{path}?ffmpeg=probe- will runffprobeand dump the JSON output containing the format and streams information. Limitation:ffprobedoesn'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 runffmpegand 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_PATHandFFPROBE_PATHenv variables (e.g.SET FFPROBE_PATH=C:\ffmpeg\bin\ffprobe.exeOn Ubuntu you'll need to install the package from the ppa:
@asapach commented on GitHub (Jan 24, 2015):
@diaskooo, could you please try it out and provide some feedback?
@ghost commented on GitHub (Mar 17, 2015):
I'll try feature with converting to MP4, but is it possible to add ability for rewinding (перемотка) video ?
@asapach commented on GitHub (Mar 17, 2015):
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:30could map to offset65536in 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.@asapach commented on GitHub (May 16, 2015):
Merging this thread into #19