initial commit
This commit is contained in:
commit
9a43ed33b7
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
PREFIX = /usr/local
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install:
|
||||||
|
cp peerflix-deadbeef ${PREFIX}/bin
|
||||||
|
|
||||||
|
.PHONY: uninstall
|
||||||
|
uninstall:
|
||||||
|
rm -f ${PREFIX}/bin/peerflix-deadbeef
|
25
README.md
Normal file
25
README.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# peerflix-deadbeef
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
peerflix-deadbeef <magnet link or torrent file>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
Make sure that `peerflix` and `deadbeef` are in your `$PATH`.
|
||||||
|
|
||||||
|
### Install
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/gch1p/peerflix-deadbeef
|
||||||
|
cd peerflix-deadbeef
|
||||||
|
sudo make install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Uninstall
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo make uninstall
|
||||||
|
```
|
27
peerflix-deadbeef
Executable file
27
peerflix-deadbeef
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
[ -z "$1" ] && {
|
||||||
|
echo "usage: peerflix-deadbeef <magnet or torrent>"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "--ready" ]]; then
|
||||||
|
host="$2"
|
||||||
|
port="$3"
|
||||||
|
|
||||||
|
file=$(mktemp --suffix=".m3u")
|
||||||
|
|
||||||
|
url="http://$host:$port/.m3u"
|
||||||
|
usleep 100000
|
||||||
|
|
||||||
|
curl "$url" > "$file"
|
||||||
|
deadbeef "$file" &
|
||||||
|
|
||||||
|
sleep 3
|
||||||
|
rm "$file"
|
||||||
|
else
|
||||||
|
host="127.0.0.1"
|
||||||
|
port=$(shuf -i 10000-20000 -n1)
|
||||||
|
|
||||||
|
peerflix "$1" -ardqh $host -p $port --on-listening "$0 --ready $host $port"
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user