spotcast
spotcast copied to clipboard
Include timestamp option in YAML
spotify URI allow for you to include a #mm:ss timestamp at the end of it to start a track from a specific point. Would this be something that could be imlemented? I tried putting a colon in the url but it breaks the syntax of the output but sing the url encode for a colon does not and it still works through a browser. Is there a possiblity of including a timestamp either in another YAML option or allow it to be included in the URI itself?
[140049427208032] http status: 400, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=3c31e63dda8e146428f7b25084e98915: Invalid track uri: spotify:track:0mHyWYXmmCB9iQyK18m3FQ#0:38, reason: None 10:44:21 AM – Home Assistant WebSocket API (ERROR) - message first occurred at 10:36:55 AM and shows up 6 times
Sure, you wanna create a PR? I have a lot to do right now so it might take time
@itzteajay-glitch I couldn't see support for this in the official API. Can you point me to the documentation for this feature?
I'd have to do some digging. But here's an example
You have a standard link to a song spotify:track:6dijvEXmPs4XA05dYPaK1J
You have a link to a song where it will start at a certain time spotify:track:6dijvEXmPs4XA05dYPaK1J#1:00
I'm not sure if this is the call you're making? Start/Resume a User's Playback https://developer.spotify.com/documentation/web-api/reference/#category-player
I'm no python expert I'd have to dig into your code more to understand it. It does look like it has a position_ms option as a parameter.
You are right. Would this be enough for your usecase? Also, is it mainly for tracks or other URi types as well?
I think tracks and shows would be useful. I didn't check if it's available for shows but that would allow snippets of podcasts to be played by home assistant in things like audio alerts.
There is actually a position_ms which can be sent in the playback request. Do you want me to add this so you can try? https://github.com/plamere/spotipy/blob/master/spotipy/client.py#L1723
@itzteajay-glitch ^^
Oh, this would be a nice addition indeed! Happy to test if needed.