@mikael That is perfect for my use case, so I can create a converter to apple music song to spotify link for sharing purpuose
Take a look if u want to integrate
The shortcut:
https://www.icloud.com/shortcuts/52b1231a7a294db9bc3b1900b96a48be
and the script code:
from spoter import Spoter
import clipboard
import webbrowser
query=clipboard.get().splitlines()
q='track:'+query[0]+' artist:'+query[1].replace('&','')+' album:'+query[2].replace('- Single','')
#apple music put & when a song is made from 2 artists and add - Single in the album name
q.replace(" ","%20")
print(q)
spot = Spoter(client_id='client_id', client_secret='client_secret')
result = spot.search(q, 'track')
clipboard.set(result['tracks']['items'][0]['external_urls']['spotify'])
url = "music://x-callback-url/run--shortcut?name=[Test]&input=clipboard"
#I Assume you are using the shortcut in share option in music app
webbrowser.open(url)
Is not perfect at 100% but I'm bad at finding "hard" testing cases