Skip to content

Instantly share code, notes, and snippets.

@T4cC0re
Created September 11, 2016 22:50
Show Gist options
  • Save T4cC0re/a2f56e86ec453eb2a9fb3917e2a35a6d to your computer and use it in GitHub Desktop.
Save T4cC0re/a2f56e86ec453eb2a9fb3917e2a35a6d to your computer and use it in GitHub Desktop.
Automatically installs makemkvcon (you still need to accept the license manually)
#!/usr/bin/env bash
# Detect version from website
VERSION="$(curl --silent "http://www.makemkv.com/download/" 2>&1 | egrep -o 'MakeMKV ([^ ]*) for' | sed 's/MakeMKV //' | sed 's/ for//' | uniq)"
DIR="$(pwd)"
WRKDIR="$(mktemp -d)"
NUMPROC="$(cat /proc/cpuinfo | grep proc | wc -l)"
# Detect beta-key from forums
REG_KEY="$(curl --silent "http://www.makemkv.com/forum2/viewtopic.php?f=5&t=1053" 2>&1 | egrep -o 'class="codecontent">([^<]*)' | sed 's/class="codecontent">//')"
# install (debian-based) dependencies
sudo apt-get install build-essential pkg-config libc6-dev libssl-dev libexpat1-dev libavcodec-dev libgl1-mesa-dev libqt4-dev
cd "${WRKDIR}"
wget "http://www.makemkv.com/download/makemkv-bin-${VERSION}.tar.gz"
wget "http://www.makemkv.com/download/makemkv-oss-${VERSION}.tar.gz"
tar -xvf makemkv-oss-*
cd makemkv-oss-*
./configure --disable-gui
make -j${NUMPROC}
sudo make install
rm -rf makemkv-oss-*
cd "${WRKDIR}"
tar -xvf makemkv-bin-*
cd makemkv-bin-*
# ./configure
make -j${NUMPROC}
sudo make install
cd "${DIR}"
rm -rf "${WRKDIR}"
# Apply current beta key (overrides settings!)
echo "app_Key = \"${REG_KEY}\"" > ~/.MakeMKV/settings.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment