alexa_media_player icon indicating copy to clipboard operation
alexa_media_player copied to clipboard

Support station ID for TUNEIN

Open sammyke007 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. You can call TuneIn by station name, but not by station ID

Describe the solution you'd like Is this possible?

Additional context This works perfectly fine:

service: media_player.play_media data: media_content_id: QMusic Belgium media_content_type: TUNEIN target: device_id: 95c5f3122764a5424bc1a1e0c60df312

this doesn't: service: media_player.play_media data: media_content_id: s2398 media_content_type: TUNEIN target: device_id: 95c5f3122764a5424bc1a1e0c60df312

You can retrieve the stationID by the last part of the browsers URL. It always starts with "s....". I can call most radiostations by name, but some not because of their special name (like MNM or NRG here in Belgium).

sammyke007 avatar Jun 20 '22 08:06 sammyke007

This code is used in alexa_remote_control.sh to search for both names or IDs for example:

if [ "${2#-}" != "${2}" -o -z "$2" ] ; then echo "ERROR: missing argument for ${1}" usage exit 1 fi STATIONID=$2 shift # stationIDs are "s1234" or "s12345" if [ -n "${STATIONID##s[0-9][0-9][0-9][0-9]*}" -a -n "${STATIONID##p[0-9][0-9][0-9][0-9]*}" ] ; then # search for station name STATIONID=$(${CURL} ${OPTS} -s --data-urlencode "query=${STATIONID}" -G "https://api.tunein.com/profiles?fullTextSearch=true" | ${JQ} -r '.Items[] | select(.ContainerType == "Stations") | .Children[] | select( .Index==1 ) | .GuideId') if [ -z "$STATIONID" ] ; then echo "ERROR: no Station \"$2\" found on TuneIn" exit 1 fi fi ;;

sammyke007 avatar Jun 20 '22 08:06 sammyke007

Thanks. Happy to take a PR if you want this functionality.

alandtse avatar Jun 24 '22 06:06 alandtse

The issue has received no activity for 60 days and will be closed in a week.

github-actions[bot] avatar Aug 24 '22 03:08 github-actions[bot]