added installer helpfile

This commit is contained in:
Alexander Bocken 2021-01-03 19:21:47 +01:00
parent a53ba1f883
commit 79dc5a1adb
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 39 additions and 1 deletions

View File

@ -12,4 +12,9 @@ This part of the script is quite generic and could easily be adjusted for other
See the documentation inside the `ripper` file for more information. See the documentation inside the `ripper` file for more information.
A Makefile will soon be added. ## Install
After `git clone`ing this repo, run the helper `installer`
```sh
./installer install
```

33
installer Executable file
View File

@ -0,0 +1,33 @@
#!/bin/sh
DESTDIR="/usr/local/bin"
XDG_VIDEOS_DIR=$HOME/vids #TODO ADJUST FOR PERSONAL USE HERE!
DLARCHIVE="${XDG_VIDEOS_DIR:-$HOME/Videos}/.downloaded"
DLLOC="${XDG_VIDEOS_DIR:-$HOME/Videos}"
CHANNELSFILE="${XDG_VIDEOS_DIR:-$HOME/Videos}/.channels"
BLACKLIST="${XDG_VIDEOS_DIR:-$HOME/Videos}/.blacklist"
install(){
mkdir -p "$DLLOC" "$(dirname "$CHANNELSFILE")" "$(dirname "$DLARCHIVE")" "$(dirname "$BLACKLIST")" "$DESTDIR"
cp ripper "$DESTDIR/ripper"
[ ! -f "$CHANNELSFILE" ] && printf '#Add channels to add in this file\n#Format: https://www.youtube.com/channel/<channelId>' > "$CHANNELSFILE"
[ ! -f "$BLACKLIST" ] && printf '#Add video URIs here (not just the IDs)' > "$BLACKLIST"
[ ! -f "$DLARCHIVE" ] && printf '#These videos will not be attempted to download again' > "$DLARCHIVE"
}
uninstall(){
rm "$DESTDIR/ripper"
}
clean(){
rm "$BLACKLIST" "$DLARCHIVE" "$CHANNELSFILE"
}
case "$1" in
"install") install;;
"uninstall") uninstall;;
"clean") clean;;
*) echo "installer [install] [uninstall] [clean]
install: installs application and adds needed files if not present
uninstall: remove application
clean: remove channels, archive, and blacklist files (use with caution!)";;
esac