this post was submitted on 22 Jan 2024
24 points (100.0% liked)

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

54476 readers
341 users here now

⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don't request invites, trade, sell, or self-promote

3. Don't request or link to specific pirated titles, including DMs

4. Don't submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-Fi Liberapay
Ko-fi Liberapay

founded 1 year ago
MODERATORS
 

Under Settings > Import List > Advanced List, there's an option to provide a List URL for a Custom List. What format would that need to be in?

all 13 comments
sorted by: hot top controversial new old
[–] shrugal@lemm.ee 3 points 9 months ago* (last edited 9 months ago) (2 children)

A JSON array that looks like this:

[
    {"MusicBrainzId": <id>},
    {"MusicBrainzId": <id>},
    {"MusicBrainzId": <id>}
    ...
]

I use it to fetch my Last.fm and ListenBrainz recommendations for example.

[–] matey@lemmy.dbzer0.com 1 points 9 months ago
[–] tiburon@lemmy.blahaj.zone 1 points 7 months ago* (last edited 7 months ago) (1 children)

Sorry for the necro, but can you expand on how you pull in your ListenBrainz rec?

[–] shrugal@lemm.ee 2 points 7 months ago (1 children)

I have a custom import list that points to the following PHP script on a local webserver:

$API_PLAYLISTS = "https://api.listenbrainz.org/1/user/%s/playlists/createdfor";
$API_PLAYLIST = "https://api.listenbrainz.org/1/playlist/%s";

$EXT_PLAYLIST = "https://musicbrainz.org/doc/jspf#playlist";
$EXT_TRACK = "https://musicbrainz.org/doc/jspf#track";

$TMPL_PLAYLIST = "https://listenbrainz.org/playlist/%s";

$USERS = [
    '<musicbrainz-username>'
];

$LISTS = [
    "weekly-exploration",
    "weekly-jam"
];

try {
    $ids = [];

    foreach ($USERS as $user) {
        $lists = fetch(sprintf($API_PLAYLISTS, $user))?->playlists ?? [];

        foreach($lists as $list) {
            $meta = $list->playlist->extension->{$EXT_PLAYLIST};
            $type = $meta->additional_metadata->algorithm_metadata->source_patch;

            if (!in_array($type, $LISTS)) continue;

            list($mbid) = sscanf($list->playlist->identifier, $TMPL_PLAYLIST);
            $songs = fetch(sprintf($API_PLAYLIST, $mbid))->playlist->track;

            foreach ($songs as $song) {
                $meta = $song->extension->{$EXT_TRACK};

                foreach ($meta->additional_metadata->artists as $artist) {
                    $ids[$artist->artist_mbid] = true;
                }
            }
        }
    }

    json(array_map(fn ($id) => ['MusicBrainzId' => $id], array_keys($ids)));
} catch (Throwable $e) {
    http_response_code(500);
    json(['error' => $e->getMessage()]);
}

// -- Util --

function json($data)
{
    header("Content-Type: application/json");
    echo json_encode($data);
}

function fetch($url)
{
    return json_decode(file_get_contents($url));
}

It fetches my "weekly exploration" and "weekly jam" playlists, extracts the artists and returns a list of artist IDs for Lidarr to import.

[–] tiburon@lemmy.blahaj.zone 1 points 7 months ago (1 children)

Thank you. Is there any chance you could share what the final output looks like?

Trying to get our own script working and it would be nice to compare to a known good output

[–] shrugal@lemm.ee 1 points 7 months ago (2 children)

It's a JSON array like the one I posted in the beginning, so: [{"MusicBrainzId":<artist1-id>},{"MusicBrainzId":<artist2-id>},...].

[–] tiburon@lemmy.blahaj.zone 1 points 7 months ago (1 children)

Ok, one last question, does this mean you are watching the entire artist? What I'm trying to do is watch a specific release/release group via the list, not the entire artist, and I can't work out the format the custom list is expecting for that

[–] shrugal@lemm.ee 1 points 7 months ago
[–] matey@lemmy.dbzer0.com 2 points 9 months ago (2 children)

Alternately (and better): is there a way to get something like Jellyseerr but for music?

[–] NarrativeBear@lemmy.world 1 points 9 months ago (1 children)

Finamp for all your local music, you will need a jellyfin server. Plexamp is pretty good as well, but you will need a Plex server.

[–] Count042@lemmy.ml 2 points 9 months ago

Jellyseer is like a request server for radar and sonarr, allowing people who use emby or jellyfin to make radar download a requested movie.

[–] shrugal@lemm.ee 1 points 9 months ago

Ombi can do that afaik.