Wednesday, December 8, 2021

#1 2021-10-16 11:30:16 am

mwg
Member
Registered: 2021-07-16
Posts: 2

Start internet radio on Apple Music

I'd like an apple script to start playing an internet radio station on Apple Music (Big Sur)

For example, I'd like to play the station CBC Radio One.  I can find the URL through apple music, and try to open it

tell application "Music"
    open location "https://music.apple.com/ca/station/cbc-radio-one/ra.1388704969"
end tell

but this does not work.

Any direction would be appreciated.

Thanks!


Filed under: radio, Apple Music

Offline

 

#2 2021-10-16 02:29:36 pm

KniazidisR
Member
From:: Greece
Registered: 2019-03-03
Posts: 2182

Re: Start internet radio on Apple Music

Not sure, but I think Music.app works with payed radio stations, listed in the iTunes Store. If you want listen you concrete free radio station for free, forgot the Music.app and use the browser instead:

Applescript:


tell application "Safari"
   activate
   open location "https://www.cbc.ca/listen/live-radio"
   my waitSafariWebPageLoading()
   do JavaScript "document.getElementsByClassName('playButton hero large no-border')[0].click();" in document 1
end tell

on waitSafariWebPageLoading()
   tell application "System Events" to tell application process "Safari"
       repeat until (UI element "Reload this page" of group 3 of toolbar 1 of window 1 exists) or (UI element "Reload this page" of group 2 of toolbar 1 of window 1 exists)
           delay 0.1
       end repeat
   end tell
end waitSafariWebPageLoading


Model: MacBook Pro
OS X: Catalina 10.15.7
Web Browser: Safari 14.1
Ram: 4 GB

Offline

 

#3 2021-10-20 12:44:24 am

technomorph
Member
Registered: 2017-12-14
Posts: 219

Re: Start internet radio on Apple Music

You can use safari to open the link:

https://music.apple.com/ca/station/cbc- … 1388704969

The music.apple.com will make Safari ask if you would like to open it in Music App

The Music  app has registered that URI.

Which might be why music doesn’t open it.
Things to try:
- remove the music.apple.com part
- try making a URL from the link
- Check the Dictionary for info on opening streams

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)