TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.42k stars 3.06k forks source link

Support ListenBrainz playlists #11565

Open ThreeDeeJay opened 3 weeks ago

ThreeDeeJay commented 3 weeks ago

Checklist

Feature description

ListenBrainz allows keeping track of song listens (scrobbles) like Last.fm and can use them to recommend new music, like a weekly playlist similar to Spotify (perhaps even better) in https://listenbrainz.org/user/USERNAME/recommendations/ > Exploration

So it would be nice if NewPipe could open and play the tracks from ListenBrainz playlist URL like https://listenbrainz.org/playlist/fce5ac51-9039-4f1a-b6a5-951278a5a928/

Why do you want this feature?

The ListenBrainz android app can only play local files, and the web player is quite finicky (doesn't support previous/next playback controls; video tucked in a corner (though I'm just interested in the audio); annoying toast notification overlays that get in the way of playback controls; after playing a track, it goes back to the first track instead of the next; etc.

Additional information

Apparently the ListenBrainz web player just searches for the Artist + Title on youtube and plays the first result, so those parameters could be obtained via the API like this: https://api.listenbrainz.org/1/playlist/fce5ac51-9039-4f1a-b6a5-951278a5a928

However, some tracks do have an associated URL so maybe those could take precedence over blind search (unless it's not available of course). For instance, the first track in that playlist (Nirvana - Smells Like Teen Spirit) points to https://musicbrainz.org/recording/5fb524f1-8cc8-4c04-a921-e34c0a911ea7 in playlist>track>0>identifier>0 and if you use that recording ID like this: https://musicbrainz.org/ws/2/recording/5fb524f1-8cc8-4c04-a921-e34c0a911ea7?inc=url-rels&fmt=json you get the link to the video (https://www.youtube.com/watch?v=hTWKbfoikeg) in relations>1>url>resource

ThreeDeeJay commented 2 weeks ago

@opusforlife2 Wait, duplicate? You mean this? https://github.com/TeamNewPipe/NewPipe/issues/7496 I'm not looking to scrobble songs to ListenBrainz, but instead be able to play its playlists. 🤔

opusforlife2 commented 2 weeks ago

Are the APIs used to access the ListenBrainz database different in the two cases?

ThreeDeeJay commented 2 weeks ago

Yup. Scrobbling is sending data (listening history) to ListenBrainz. This FR is about getting data (playlists and YouTube links) from LB.

opusforlife2 commented 2 weeks ago

I'm asking if the API to do those things is separate or the same. For example, torrent clients use the same protocol to talk to peers whether downloading or uploading. They're not separate things.

The idea is that if the APIs are separate, these are two different issues. If it's the same, your feature request is an additional functionality that can be expressed as a comment on that issue.

ThreeDeeJay commented 2 weeks ago

I personally use listenbrainz, but i know both listenbrainz and libre.fm have last.fm compatible apis so it should only be necessary to support the last.fm api and allow users to shoose a url.

The OP in #7496 suggested using the Last.FM/AudioScrobbler API for cross-compatibility across all 3 scrobbling services, so if I understand correctly, scrobbling and playlists would use different APIs, but run on the same server. But if these issues are to be merged, I think it'd make more sense to rename the other issue to something more general like ListenBrainz integration, and have scrobbling and playlists as different tasks 🤔

opusforlife2 commented 2 weeks ago

This has quickly gone above my understanding. I'll just reopen this and a knowledgeable dev can decide what to do. :P