Feature request: easily switch api_endpoint
Currently I use calibre-web as my api_endpoint, but that's hosted locally and on vacation I rather use the bol/kobo store. Would it be possible to have a switch in NickelMenu to change the api_endpoint (and reboot), so I can choose where to download books from?
What I did is this:
- Edit your configuration file
Kobo eReader.confto include an additional keyapi_endpoint_backup=.... - Next to this file, create a file
switch.shwith the content below:
#/bin/bash
set -e
SCRIPT_DIR=$(dirname -- "$( readlink -f -- "$0"; )")
cd "${SCRIPT_DIR}"
INPUT="Kobo eReader.conf"
# Extract the values into variables
api_endpoint_value=$(sed -n 's/^api_endpoint=//p' "$INPUT")
api_endpoint_backup_value=$(sed -n 's/^api_endpoint_backup=//p' "$INPUT")
# Replace values
sed -i.bak \
-e "s|^api_endpoint=.*|api_endpoint=$api_endpoint_backup_value|" \
-e "s|^api_endpoint_backup=.*|api_endpoint_backup=$api_endpoint_value|" "$INPUT"
# Output result
cat "${INPUT}" | grep "api_endpoint\="
- Make sure to
chmod +x switch.sh - Edit your config file
/mnt/onboard/.adds/nm/configand add the line below:menu_item :main :SwitchEndpoint :cmd_output :500:/mnt/onboard/.kobo/Kobo/switch.sh
You can then run this action from the NickelMenu and reboot your Kobo to apply it.
@ragusa87 Thank you sir! It's working!
Regarding the first point, please remember to add the following two lines to your Kobo eReader.conf:
api_endpoint=https://yourdomain/kobo/........... api_endpoint_backup=https://storeapi.kobo.com/
This ensures that your Kobo device will have the correct main and backup API endpoints configured.