#!/bin/bash

DEST=${1:-/etc/skel}
ALIAS_DIR=".zshrc.d"
mkdir -p ${DEST}/${ALIAS_DIR}

# https://github.com/webtorrent/webtorrent-cli
npm install --global webtorrent-cli

# https://github.com/mafintosh/peerflix
npm install --global peerflix

# https://github.com/AnthonyBloomer/ezflix
pip install ezflix

ALIAS_FILE=${DEST}/${ALIAS_DIR}/003_local.sh
cat <<EOF | sudo tee -a ${ALIAS_FILE} >/dev/null
alias wtmpv='webtorrent --mpv --blocklist https://dbl.oisd.nl/ --upload-limit 20 --subtitiles' 
alias peerflix='peerflix --blocklist https://dbl.oisd.nl/ --mpv --subtitles --remove'
EOF
