Skip to content

Instantly share code, notes, and snippets.

@texora
Last active March 16, 2023 13:46
Show Gist options
  • Save texora/e4838c040b9f2ffd0b38e75b825b222e to your computer and use it in GitHub Desktop.
Save texora/e4838c040b9f2ffd0b38e75b825b222e to your computer and use it in GitHub Desktop.
#!/bin/sh
cd $1
mkdir -p bin
cd bin
## instal youtube-dl
YOUTUBE_DL_VERSION="$(curl -s https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest | grep '"tag_name":' | sed -E 's/.*"(.+)".?/\1/')"
YOUTUBE_DL_DOWNLOAD_URL="https://github.com/ytdl-org/youtube-dl/releases/download/$YOUTUBE_DL_VERSION/youtube-dl"
curl -Ls $YOUTUBE_DL_DOWNLOAD_URL -o youtube-dl
chmod a+rx youtube-dl
## install aria2c
ARIA2C_VERSION="$(curl -s https://api.github.com/repos/q3aql/aria2-static-builds/releases/latest | grep '"tag_name":' | sed -E 's/.*"v(.+)".*/\1/')"
ARIA2C_FILE="aria2-$ARIA2C_VERSION-linux-gnu-64bit-build1"
ARIA2C_DOWNLOAD_URL="https://github.com/q3aql/aria2-static-builds/releases/download/v$ARIA2C_VERSION/$ARIA2C_FILE.tar.bz2"
wget -q $ARIA2C_DOWNLOAD_URL
tar jxf $ARIA2C_FILE.tar.bz2
mv $ARIA2C_FILE/* .
rm -rf $ARIA2C_FILE $ARIA2C_FILE.tar.bz2
## install rclone
RCLONE_FILE="rclone-current-linux-amd64"
RCLONE_DOWNLOAD_URL="https://downloads.rclone.org/$RCLONE_FILE.zip"
wget -q $RCLONE_DOWNLOAD_URL
unzip -qqjo $RCLONE_FILE.zip
rm -rf $RCLONE_FILE.zip
## install ffmpeg
FFMPEG_DOWNLOAD_URL="https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz"
curl -L --silent $FFMPEG_DOWNLOAD_URL | tar xJ --strip-components=1
echo "exporting PATH"
PROFILE_PATH="$1/.profile.d/binaries.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="$PATH:${HOME}/bin"' >> $PROFILE_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment