Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stored track URIs are not re-useable #67

Open
fatg3erman opened this issue Oct 2, 2022 · 18 comments
Open

Stored track URIs are not re-useable #67

fatg3erman opened this issue Oct 2, 2022 · 18 comments
Assignees

Comments

@fatg3erman
Copy link
Contributor

Don't know if this is just how Youtube Music works, but if I store a track URI (say from a search or a playlist) then try to add it to the tracklist at a later date (after restarting mopidy) I get 'Track is not playable'.

I'd like to be able to create local lists of tracks, since I can't use Mopidy to add things to "Liked Songs" or whatever on YTMusic.

@fatg3erman
Copy link
Contributor Author

Seems that they work if the the extension has already cached them. For example if I add one of my 'Liked Songs' to the tracklist and copy the Uri, then restart Mopidy: Initially trying to add that Uri results in "directory or file not found", but if I browse my 'Liked Songs' and then try again I can add that Uri.

This is contrary to how other Mopidy backends work - eg Spotify used to allow you to add any Uri regardless.

@bendschs
Copy link

bendschs commented Oct 3, 2022

i think this is the same problem as described here:

#24

@hofaa
Copy link

hofaa commented Nov 3, 2022

I think I have the same problem here:
I have local playlists (m3u) with YTmusic URIs "ytmusic:track:MOabEBSxxxxx"
When sending (over Iris)
{"method":"core.tracklist.add","params":{"uris":["ytmusic:track:MOab....
I just get result = []

Also Iris does not show any track info, no cover etc.

If I find the album or a track via "Browse > YTMusic" or "Recently played" etc. the cover and track info appears, also in the playlist. But only for the songs that were displayed before in "Browse" etc.

Now it is also possible to add them to the tracklist

@jaedb
Copy link

jaedb commented Nov 8, 2022

@hofaa one thing you can try is reloading that particular playlist. In Iris use the context menu (right click on the thumbnail from a grid page, or the ... icon within the Playlist) and hit Refresh.

@hofaa
Copy link

hofaa commented Nov 8, 2022

@jaedb thank you for the hint.
Unfortunatelly that does not change anything. Iris still only shows the URIs instead of track names after Refreshing and adding to the tracklist (playing) is not possible.

@jaedb
Copy link

jaedb commented Nov 15, 2022

Ah yes I understand now (I misread your comment, sorry). This would work if they belonged to a YT Music playlist, but not a local playlist.

It seems like Track URIs are bound by an authenticated session, so when the session ends (ie restarting, or running mopidy ytmusic reauth) the URIs are invalidated.

@OzymandiasTheGreat do you happen to know how ytmusicapi generates track URIs? Do they have any reference to the track ID in YT Music or are they localised to the ytmusicapi session?

@fatg3erman
Copy link
Contributor Author

The track Uris are re-useable but somehow they're tied to a session and you need to do [insert something opaque and hacky] to use them if you restart, Mopidy-youtube does something with yt-dlp to make this work

@hofaa
Copy link

hofaa commented Nov 23, 2022

@jaedb and @fatg3erman is there something I can do, or does it need implemented in mopidy-ytmusic?
I did not find any solution to actually get the track Uris reliably working again after a restart. Most of the time it helps though to find the corresponding track via "browse" on YTMusic, but that defeats the purpose of a playlist...

@fatg3erman
Copy link
Contributor Author

@hofaa As far as I can tell there's nothing you can do, a track needs to have been browsed to make it playable.

@jaedb
Copy link

jaedb commented Nov 23, 2022

The issue with playlists is not apparent for YT-Music playlists (even your own), so perhaps the priority could be put on managing YT-Music playlists within Mopidy? This is already supported by ytmusicapi so we're not trying to swim against the current then.

@fatg3erman
Copy link
Contributor Author

I think that already works. The problem is I don't want to store my playlists on YT Music because Mopidy supports multiple backends and I don't want to be tied to one source.

@impliedchaos
Copy link
Collaborator

Sorry, I've been really busy with work, and it's been a while since I looked at the backend. But I'm on holiday this weekend and will try to look at this. Getting better integration with RompЯ and other frontends would be fantastic.

@impliedchaos impliedchaos self-assigned this Nov 23, 2022
@fatg3erman
Copy link
Contributor Author

Hi @impliedchaos that's cool, we all have stuff to do :) I've been putting quite a lot of effort into RompR in an attempt to use YTMusic as a Spotify replacement. i have it working quite well here, with the modification I've sent you a PR for. This allows me to add any track URI provided I know the album URI. Looking up the album makes the track URI valid. Somehow :)

The ability to add any old track URI is the only missing piece. I looked briefly at how mopidy-youtube does it but I'm not really a python guy and I couldn't figure it out. I think it does something with yt-dlp to make the URI valid, but I'm not sure what it is.

impliedchaos added a commit that referenced this issue Nov 28, 2022
@impliedchaos
Copy link
Collaborator

OK, the 0.3.8 release should sorta fix this. There is still an issue where it's damned near impossible to get the album from a track. Because google.

@fatg3erman
Copy link
Contributor Author

Nice! I'll give it a spin as soon as I get a chance.

"Becasue google" 😂

@hofaa
Copy link

hofaa commented Dec 1, 2022

@impliedchaos you are the best, that works like a charm. Really makes a difference for me and the plugin complete!
Thank you a lot!!

@fatg3erman
Copy link
Contributor Author

That is working beautifully. Thanks @impliedchaos.

@bendschs
Copy link

bendschs commented Dec 3, 2022

works for me too now, thanks to all of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants