From 8ceb743611f763b775679a690c36b29cda25e2f0 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 28 Jan 2021 21:31:27 +0100 Subject: [PATCH] fixed new API endpoint for automations --- alexa_remote_control.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alexa_remote_control.sh b/alexa_remote_control.sh index 35d9327..dfaa933 100755 --- a/alexa_remote_control.sh +++ b/alexa_remote_control.sh @@ -61,6 +61,8 @@ # ( https://github.com/thorsten-gehrig/alexa-remote-control/issues/108 ) # 2020-12-12: v0.17a sounds now benefit from SPEAKVOL # fixed TuneIn IDs to also play podcasts +# 2021-01-28: v0.17b fixed new API endpoint for automations +# (thanks to Michael Winkler) # ### # @@ -218,7 +220,7 @@ usage() while [ "$#" -gt 0 ] ; do case "$1" in --version) - echo "v0.17a" + echo "v0.17b" exit 0 ;; -d) @@ -643,7 +645,7 @@ if [ -n "${SEQUENCECMD}" ] ; then ${CURL} ${OPTS} -s -b ${COOKIE} -A "${BROWSER}" -H "DNT: 1" -H "Connection: keep-alive" -L\ -H "Content-Type: application/json; charset=UTF-8" -H "Referer: https://alexa.${AMAZON}/spa/index.html" -H "Origin: https://alexa.${AMAZON}"\ -H "csrf: $(awk "\$0 ~/.${AMAZON}.*csrf[ \\s\\t]+/ {print \$7}" ${COOKIE})" -X GET \ - "https://${ALEXA}/api/behaviors/automations?limit=200" > "${TMP}/.alexa.automation" + "https://${ALEXA}/api/behaviors/v2/automations?limit=200" > "${TMP}/.alexa.automation" AUTOMATION=$(jq --arg utterance "${UTTERANCE}" -r '.[] | select( .triggers[].payload.utterance == $utterance) | .automationId' "${TMP}/.alexa.automation") if [ -z "${AUTOMATION}" ] ; then