Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noctuid/mpv-peerflix-hook
Stream magnet links in mpv with peerflix
https://github.com/noctuid/mpv-peerflix-hook
Last synced: about 1 month ago
JSON representation
Stream magnet links in mpv with peerflix
- Host: GitHub
- URL: https://github.com/noctuid/mpv-peerflix-hook
- Owner: noctuid
- Created: 2020-01-10T02:32:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T19:50:45.000Z (over 4 years ago)
- Last Synced: 2024-08-05T14:16:14.657Z (3 months ago)
- Language: Lua
- Size: 11.7 KB
- Stars: 7
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
- awesome-mpv - peerflix-hook - Stream magnet links in mpv with peerflix. (Streaming)
README
* Disclaimer
I recommend using [[https://github.com/noctuid/mpv-webtorrent-hook][mpv-webtorrent-hook]] instead.* About
This is a modified version of [[https://gist.github.com/ekisu/bba287693830055a6bad90081c1ad4e2][this gist]]. It allows mpv to handle/stream magnet links directly using peerflix.One reason you might want to do this over using ~peerflix~ directly is that with this, you can start mpv with a playlist of multiple magnet links or add magnet links to the playlist of an already open mpv window (e.g. using one of the scripts that allow appending a link from the clipboard to the playlist).
Another reason you might want to use this script is that it can remove the videos after they are done playing, so they don't stick around and completely fill up =/tmp=. Peerflix has a =--remove= flag, but it is broken (see the link below).
This script does not change any configuration/flags by default. Peerflix adds =--ontop= by default (which I personally find annoying). You can disable this by adding =--no-ontop=, so this isn't really an advantage just a difference. By using this script, you can also see mpv output (which is hidden when calling ~peerflix~ directly). On the other hand, you won't see the normal ~peerflix~ output using this script.
Functional differences from the original script:
- Works correctly even if another peerflix instance is already using port 8888
- Kills the correct peerflix instance when finished instead of killing all peerflix processes
- Sets the media title of the video to the filename
- Doesn't try to look for a local peerflix binary
- Doesn't use the =--remove= (=-r=) flag (since it [[https://github.com/mafintosh/peerflix/pull/332][doesn't really work]]); optionally removes videos that are not open insteadRequirements:
- on linux (or maybe similar)
- peerflix
- bash
- lsof* Configuration
In =~/.config/mpv/script-opts/peerflix-hook.conf=, you can change the following settings:
- =kill_peerflix= - whether to kill peerflix after finishing the video; peerflix will keep running if you set this to =no=, so only change this if you want to handle closing peerflix yourself (default: =yes=)
- =remove_files= - whether to remove any videos files that are not being used after finishing the video; if this is =yes=, =kill_peerflix= must also be =yes= for it to work (default: =yes=)
- =peerflix_directory= - directory where videos are stored; I haven't checked if this ever needs to be changed; the default may always be correct (default: =/tmp/torrent-stream=)You probably won't want to change any of these settings unless you want to keep downloaded videos (in which case, you can set =remove_files= to =no=).