mirror of
				https://github.com/thorsten-gehrig/alexa-remote-control.git
				synced 2025-11-04 16:07:36 +01:00 
			
		
		
		
	Made oathtool configurable
This commit is contained in:
		@@ -13,6 +13,7 @@ ALEXA     - the URL you would use for the Alexa Web App
 | 
				
			|||||||
CURL      - location of your cURL binary
 | 
					CURL      - location of your cURL binary
 | 
				
			||||||
OPTS      - any cURL options you require
 | 
					OPTS      - any cURL options you require
 | 
				
			||||||
TMP       - location of the temp dir
 | 
					TMP       - location of the temp dir
 | 
				
			||||||
 | 
					OATHTOOL  - command line for oathtool MFA
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
You will very likely want to set the language to:
 | 
					You will very likely want to set the language to:
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
@@ -51,9 +52,3 @@ alexa-remote-control [-d <device>|ALL] -e <pause|play|next|prev|fwd|rwd|shuffle|
 | 
				
			|||||||
There's also a "plain" version, which lacks some functionality (-i, -p, -P, -S and no radio station names and no routines) but doesn't require 'jq' for JSON processing.
 | 
					There's also a "plain" version, which lacks some functionality (-i, -p, -P, -S and no radio station names and no routines) but doesn't require 'jq' for JSON processing.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
http://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html
 | 
					http://blog.loetzimmer.de/2017/10/amazon-alexa-hort-auf-die-shell-echo.html
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								alexa_remote_control.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										12
									
								
								alexa_remote_control.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -56,7 +56,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SET_EMAIL='amazon_account@email.address'
 | 
					SET_EMAIL='amazon_account@email.address'
 | 
				
			||||||
SET_PASSWORD='Very_Secret_Amazon_Account_Password'
 | 
					SET_PASSWORD='Very_Secret_Amazon_Account_Password'
 | 
				
			||||||
#SET_MFA_SECRET='1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG'
 | 
					SET_MFA_SECRET=''
 | 
				
			||||||
 | 
					# something like:
 | 
				
			||||||
 | 
					#  1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SET_LANGUAGE='de,en-US;q=0.7,en;q=0.3'
 | 
					SET_LANGUAGE='de,en-US;q=0.7,en;q=0.3'
 | 
				
			||||||
#SET_LANGUAGE='en-US'
 | 
					#SET_LANGUAGE='en-US'
 | 
				
			||||||
@@ -83,6 +85,9 @@ SET_OPTS='--compressed --http1.1'
 | 
				
			|||||||
SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:1.0) bash-script/1.0'
 | 
					SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:1.0) bash-script/1.0'
 | 
				
			||||||
#SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0'
 | 
					#SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# oathtool command line
 | 
				
			||||||
 | 
					SET_OATHTOOL='oathtool --base32 --totp'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# tmp path
 | 
					# tmp path
 | 
				
			||||||
SET_TMP="/tmp"
 | 
					SET_TMP="/tmp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -102,6 +107,7 @@ CURL=${CURL:-$SET_CURL}
 | 
				
			|||||||
OPTS=${OPTS:-$SET_OPTS}
 | 
					OPTS=${OPTS:-$SET_OPTS}
 | 
				
			||||||
TTS_LOCALE=${TTS_LOCALE:-$SET_TTS_LOCALE}
 | 
					TTS_LOCALE=${TTS_LOCALE:-$SET_TTS_LOCALE}
 | 
				
			||||||
TMP=${TMP:-$SET_TMP}
 | 
					TMP=${TMP:-$SET_TMP}
 | 
				
			||||||
 | 
					OATHTOOL=${OOATHTOOL:-$SET_OATHTOOL}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COOKIE="${TMP}/.alexa.cookie"
 | 
					COOKIE="${TMP}/.alexa.cookie"
 | 
				
			||||||
DEVLIST="${TMP}/.alexa.devicelist.json"
 | 
					DEVLIST="${TMP}/.alexa.devicelist.json"
 | 
				
			||||||
@@ -407,8 +413,8 @@ ${CURL} ${OPTS} -s -c ${COOKIE} -b ${COOKIE} -A "${BROWSER}" -H "Accept-Language
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# add OTP if using MFA
 | 
					# add OTP if using MFA
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
if [ ! -z "${MFA_SECRET}" ] ; then
 | 
					if [ -n "${MFA_SECRET}" ] ; then
 | 
				
			||||||
	OTP=$(oathtool --base32 --totp "${MFA_SECRET}")
 | 
						OTP=$(${OATHTOOL} "${MFA_SECRET}")
 | 
				
			||||||
	PASSWORD="${PASSWORD}${OTP}"
 | 
						PASSWORD="${PASSWORD}${OTP}"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								alexa_remote_control_plain.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										12
									
								
								alexa_remote_control_plain.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							@@ -15,7 +15,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SET_EMAIL='amazon_account@email.address'
 | 
					SET_EMAIL='amazon_account@email.address'
 | 
				
			||||||
SET_PASSWORD='Very_Secret_Amazon_Account_Password'
 | 
					SET_PASSWORD='Very_Secret_Amazon_Account_Password'
 | 
				
			||||||
#SET_MFA_SECRET='1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG'
 | 
					SET_MFA_SECRET=''
 | 
				
			||||||
 | 
					# something like:
 | 
				
			||||||
 | 
					#  1234 5678 9ABC DEFG HIJK LMNO PQRS TUVW XYZ0 1234 5678 9ABC DEFG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SET_LANGUAGE='de,en-US;q=0.7,en;q=0.3'
 | 
					SET_LANGUAGE='de,en-US;q=0.7,en;q=0.3'
 | 
				
			||||||
#SET_LANGUAGE='en-US'
 | 
					#SET_LANGUAGE='en-US'
 | 
				
			||||||
@@ -42,6 +44,9 @@ SET_OPTS='--compressed --http1.1'
 | 
				
			|||||||
SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:1.0) bash-script/1.0'
 | 
					SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:1.0) bash-script/1.0'
 | 
				
			||||||
#SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0'
 | 
					#SET_BROWSER='Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# oathtool command line
 | 
				
			||||||
 | 
					SET_OATHTOOL='oathtool --base32 --totp'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# tmp path
 | 
					# tmp path
 | 
				
			||||||
SET_TMP="/tmp"
 | 
					SET_TMP="/tmp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -61,6 +66,7 @@ CURL=${CURL:-$SET_CURL}
 | 
				
			|||||||
OPTS=${OPTS:-$SET_OPTS}
 | 
					OPTS=${OPTS:-$SET_OPTS}
 | 
				
			||||||
TTS_LOCALE=${TTS_LOCALE:-$SET_TTS_LOCALE}
 | 
					TTS_LOCALE=${TTS_LOCALE:-$SET_TTS_LOCALE}
 | 
				
			||||||
TMP=${TMP:-$SET_TMP}
 | 
					TMP=${TMP:-$SET_TMP}
 | 
				
			||||||
 | 
					OATHTOOL=${OOATHTOOL:-$SET_OATHTOOL}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COOKIE="${TMP}/.alexa.cookie"
 | 
					COOKIE="${TMP}/.alexa.cookie"
 | 
				
			||||||
DEVLIST="${TMP}/.alexa.devicelist.json"
 | 
					DEVLIST="${TMP}/.alexa.devicelist.json"
 | 
				
			||||||
@@ -347,8 +353,8 @@ ${CURL} ${OPTS} -s -c ${COOKIE} -b ${COOKIE} -A "${BROWSER}" -H "Accept-Language
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# add OTP if using MFA
 | 
					# add OTP if using MFA
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
if [ ! -z "${MFA_SECRET}" ] ; then
 | 
					if [ -n "${MFA_SECRET}" ] ; then
 | 
				
			||||||
	OTP=$(oathtool --base32 --totp "${MFA_SECRET}")
 | 
						OTP=$(${OATHTOOL} "${MFA_SECRET}")
 | 
				
			||||||
	PASSWORD="${PASSWORD}${OTP}"
 | 
						PASSWORD="${PASSWORD}${OTP}"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user