From 7cd30fa4bd0bb336edbe568d78637089ceb0930c Mon Sep 17 00:00:00 2001 From: txjp Date: Sat, 13 May 2023 18:13:40 +0900 Subject: [PATCH] fixed alexa url reffering https://github.com/thorsten-gehrig/alexa-remote-control/issues/166 --- alexa_remote_control.sh | 2 +- alexa_remote_control_plain.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alexa_remote_control.sh b/alexa_remote_control.sh index 7275e79..c17ad35 100755 --- a/alexa_remote_control.sh +++ b/alexa_remote_control.sh @@ -523,7 +523,7 @@ if [ -z "${REFRESH_TOKEN}" ] ; then # get first cookie and write redirection target into referer # ${CURL} ${OPTS} -s -D "${TMP}/.alexa.header" -c ${COOKIE} -b ${COOKIE} -A "${BROWSER}" -H "Accept-Language: ${LANGUAGE}" -H "DNT: 1" -H "Connection: keep-alive" -H "Upgrade-Insecure-Requests: 1" -L\ - https://alexa.${AMAZON} | grep "hidden" | sed 's/hidden/\n/g' | grep "value=\"" | sed -r 's/^.*name="([^"]+)".*value="([^"]+)".*/\1=\2\&/g' > "${TMP}/.alexa.postdata" + https://alexa.${AMAZON}/spa/index.html | grep "hidden" | sed 's/hidden/\n/g' | grep "value=\"" | sed -r 's/^.*name="([^"]+)".*value="([^"]+)".*/\1=\2\&/g' > "${TMP}/.alexa.postdata" # # login empty to generate session diff --git a/alexa_remote_control_plain.sh b/alexa_remote_control_plain.sh index ba0155e..5ba9fc5 100755 --- a/alexa_remote_control_plain.sh +++ b/alexa_remote_control_plain.sh @@ -393,7 +393,7 @@ rm -f ${COOKIE} # get first cookie and write redirection target into referer # ${CURL} ${OPTS} -s -D "${TMP}/.alexa.header" -c ${COOKIE} -b ${COOKIE} -A "${BROWSER}" -H "Accept-Language: ${LANGUAGE}" -H "DNT: 1" -H "Connection: keep-alive" -H "Upgrade-Insecure-Requests: 1" -L\ - https://alexa.${AMAZON} | grep "hidden" | sed 's/hidden/\n/g' | grep "value=\"" | sed -r 's/^.*name="([^"]+)".*value="([^"]+)".*/\1=\2\&/g' > "${TMP}/.alexa.postdata" + https://alexa.${AMAZON}/spa/index.html | grep "hidden" | sed 's/hidden/\n/g' | grep "value=\"" | sed -r 's/^.*name="([^"]+)".*value="([^"]+)".*/\1=\2\&/g' > "${TMP}/.alexa.postdata" # # login empty to generate session