docker-makemkv icon indicating copy to clipboard operation
docker-makemkv copied to clipboard

Easier update

Open camjac251 opened this issue 7 years ago • 5 comments

Thank you for making these scripts. Updating broke for me a while back when a gist using lynx stopped working. I've simplified the update script to just one script now thanks to this person's https://github.com/AyrA/MakeMKV site https://cable.ayra.ch/makemkv/. It's very basic right now but could potentially be better.

This is what I use currently

#!/bin/sh

usage() {
    echo "usage: $(basename $0) KEY CONFIG_FILE

This script updates the MakeMKV configuration with the provided key.
"
}

KEY=$(wget -qO- https://cable.ayra.ch/makemkv/api.php?raw)

CONFIG_FILE=/path/to/.MakeMKV/settings.conf

# Get the current  key.
CUR_KEY="$(sed -n 's|^[ \t]*app_Key[ \t]*=[ \t]*"\(.*\)"[ \t]*$|\1|gp' "$CONFIG_FILE")"

# If not the same, update it.
if [ "$CUR_KEY" != "$KEY" ]; then
    echo "Updating registration key..."
    if grep -q '^app_Key ' "$CONFIG_FILE"; then
        sed -i "/^[ \t]*app_Key[ \t]*=/c\app_Key = \"$KEY\"" "$CONFIG_FILE"
    else
        echo "app_Key = \"$KEY\"" >> "$CONFIG_FILE"
    fi
else
    echo "Registration key already up-to-date."
fi

# vim: set ft=sh :

It could work better as a cronjob if it used api.php?json instead and saved a local file with the keydate and just checked to see if the two match, then it would know that the key is the same and doesn't need to be updated. And when they don't match then it could update.

camjac251 avatar Oct 24 '18 09:10 camjac251

Sorry did you post your message to the right repository? This repository is for the Docker container of MakeMKV and beta key update is already automatically handled.

jlesage avatar Oct 25 '18 13:10 jlesage

I found the scripts here https://github.com/jlesage/docker-makemkv/tree/master/rootfs/opt/makemkv/bin

This is the repo that the scripts exist on right? Or is the docker sourced from another repo?

camjac251 avatar Oct 25 '18 13:10 camjac251

These scripts are used by the container to update the key. They are not generic scripts that can be used outside the container, or in a different context.

jlesage avatar Oct 25 '18 13:10 jlesage

I was able to use them and amended an update above that uses the nice website someone made for retrieving the api code. Just thought I'd post it here in case someone came across this like I did.

camjac251 avatar Oct 25 '18 13:10 camjac251

I agree that it's easier to use this service than parsing the web page. I was not sure to use it because this service is probably also parsing the web page. So if the web page changes and parsing need to be updated, we rely on a service for which we have no control. However, maybe it could be used as a backup source...

jlesage avatar Oct 30 '18 10:10 jlesage