Skip to content

Instantly share code, notes, and snippets.

@asm0dey
Forked from abakum/install_peerflix
Last active June 30, 2018 19:55
Show Gist options
  • Save asm0dey/c0907d8f30233cb8f1f4b6d8c23e23dd to your computer and use it in GitHub Desktop.
Save asm0dey/c0907d8f30233cb8f1f4b6d8c23e23dd to your computer and use it in GitHub Desktop.
Use peerflix for kodi@OSMC on raspberry Pi
#!/bin/bash
mkdir -p ~/ins
cd ~/ins
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
sudo npm install -g peerflix
#!/bin/bash -x
if [ -z "$1" ]; then
echo "No argument supplied"
exit 1
fi
MAGNET="$1"
STREAM_FILE=$(mktemp)
ON_LISTENING=$(mktemp)
trap 'rm -f '"$STREAM_FILE $ON_LISTENING" 1 2
echo 'http://127.0.0.1:8888' > "$STREAM_FILE"
echo 'xbmc-send --host=127.0.0.1 --port=9777 --action="'"PlayMedia($STREAM_FILE)"'"' > "$ON_LISTENING"
chmod +x "$ON_LISTENING"
peerflix "$MAGNET" -q -f ~/Downloads --on-listening "$ON_LISTENING" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment