Giter Site home page Giter Site logo

Comments (24)

BobbyWibowo avatar BobbyWibowo commented on May 27, 2024 3

I ended up implementing this on my personal-use fork (BobbyWibowo@907949b ... BobbyWibowo@f88a7b5)

Mostly by "stealing" our existing Config class and some bits and pieces from phineas05/discord-rich-presence-plex
However I'm not going to make a PR because I don't trust my current Python experience for public usage

Linking them for references, and to hopefully kickstart FichteFoll early to implement it themselves, lmao

I also found it troublesome to make it auto-create an empty JSON cache file, so I did not
Users must create an empty valid JSON file named cache.json in their local discordrp-mpris config directory to even start using it


YouTube videos via plasma-browser-integration (as-is due to using YouTube thumb url directly)
image

Strawberry Music Player (auto-upload local album cover to imgur)
image


Also I just noticed the actual media players became unrecognizable due to no icons or texts, lmao, but I'm not gonna bother with that (I forgot player name is available via hover text on large image)

from discordrp-mpris.

FichteFoll avatar FichteFoll commented on May 27, 2024 2

It's not possible to use arbitrary icons with the Rich Presence API. All icons must be uploaded for the registered app first and can then be referenced by name.

It may be possible for everyone to maintain a custom app and then have discordrp-mpris upload album art assets there, but I don't know how fast the images are updated (the website takes minutes to list newly added icons). Would also be quite a bit of work, although the feature is nice.

from discordrp-mpris.

jojo2357 avatar jojo2357 commented on May 27, 2024

Discord has recently added support for URL's as a rich presence asset, although I am not sure how many libraries are supporting that right now.

I am the maintainer of MDRP, and I am in the process of using the ITunes api to get a url that refers to the art for a specific album, searchable by artist, album, and song. I unfortunately have to use an alpha build of the c# library, so this is probably not supported in python yet

from discordrp-mpris.

FichteFoll avatar FichteFoll commented on May 27, 2024

That sounds interesting. Can you point me to some documentation on this new feature or alternatively the code of this c# library? I fear it might be using a different IPC interface than what I am currently using since they did add another API after I wrote this.

Note that it's not a high priority for me at the moment.

from discordrp-mpris.

jojo2357 avatar jojo2357 commented on May 27, 2024

https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets

and

https://discord.com/developers/docs/topics/gateway#activity-object-activity-asset-image

from discordrp-mpris.

BobbyWibowo avatar BobbyWibowo commented on May 27, 2024

It appears to be possible to use remote URLs of any file hosts as-is into both large_image and small_image fields
It is the solution currently implemented in phineas05 / discord-rich-presence-plex

A bit more details over here TheQwertiest/foo_discord_rich#6 (comment)

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

Yeah? this addition seems to be good. There is a discord documentation available on this idea. The link from upper comment don't work. So, please, can you make it?
Also, there's metadata type which has base32 encoded image as I remember.

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

I've just started making fork of this masterpiece, but with album arts. As I see, you can just pass http URLs and it will show the album art from metadata (I've just used ctrl+C ctrl+V and changed one condition with resulting activity for a bit). I'm now working on any other URLs because there's commonly rfc2397 URL, which discord (for some reason) can't use. Though, we can easily get image from there and use it.

from discordrp-mpris.

FichteFoll avatar FichteFoll commented on May 27, 2024

Since you seem to have made some investigations already, which application uses which scheme?

For data: URLs, much like file:, I believe we would need to upload the images somewhere so that discord can find/reference them via http, which isn't exactly a small overhead if we also want to make that configurable. Otherwise I would simply pick a reliable temporary fire-and-forget host like 0x0.st. This upload behavior would definitely need to be disabled by default, however.

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

Getting image isn't a problem because urllib from python standard library does it. Only problem is to use it with discord. We need to send them to some host (user-defined?), get https: link and done. Seems easy

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

I've just made a pull request #32 with solution to this issue

from discordrp-mpris.

FichteFoll avatar FichteFoll commented on May 27, 2024

On the next branch, I have implemented the first version of this by honoring the mpris:artUrl metadata field and using it when it starts with http:// or https://, which I tested with mpv and the youtube-dl integration. FireFox shows a local path in this field, so unfortunately that doesn't work just yet. This was inspired by 47cbc89.

I'll see when I get around to thinking more about how I want the custom file upload to be structured & configured to allow for sufficient flexibility.

from discordrp-mpris.

mariuszste avatar mariuszste commented on May 27, 2024

I'll see when I get around to thinking more about how I want the custom file upload to be structured & configured to allow for sufficient flexibility.

Maybe s3 with a custom endpoint? That would be the most universal option, most hosting providers provide an s3 compatible storage for penies + can easily be self hosted with something like minio. A public image upload site is also fine as a default "may or might not work" alternative for people that can't/don't want to use s3.

Another funny (free) way would be to have a discord bot upload them on some random channel and then just feed the discord cdn url back to discord 🤣 but that is a bit overkill imo

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

I'll see when I get around to thinking more about how I want the custom file upload to be structured & configured to allow for sufficient flexibility.

Maybe s3 with a custom endpoint? That would be the most universal option, most hosting providers provide an s3 compatible storage for penies + can easily be self hosted with something like minio. A public image upload site is also fine as a default "may or might not work" alternative for people that can't/don't want to use s3.

Another funny (free) way would be to have a discord bot upload them on some random channel and then just feed the discord cdn url back to discord rofl but that is a bit overkill imo

I've done this in my fork already, but it's just too simple to be there. It's just for an example and a start point to go

from discordrp-mpris.

9p4 avatar 9p4 commented on May 27, 2024

Perhaps musicbrainz integration? Pull metadata of the song to automatically find a URL to the album art?

from discordrp-mpris.

HxxThSwggr avatar HxxThSwggr commented on May 27, 2024

There is a MusicBee discord plugin which has working album art.

I thought it might help y'all.

from discordrp-mpris.

FichteFoll avatar FichteFoll commented on May 27, 2024

Is anyone here actually interested in being able to choose the image hosting service or would you be fine with anything as long as it works? Not having to implement imgur uploading for example and only considering very simple pomf-like HTTP POST upload services would make the first iteration a lot easier to implement.

Well, to be honest, I would do those implementations first anyway because they are so simple. Other upload services might then get added later on an on-demand basis.

from discordrp-mpris.

mariuszste avatar mariuszste commented on May 27, 2024

Is anyone here actually interested in being able to choose the image hosting service

not having to rely on some random host that might break/rate limit you at any monet is definitely appreciated. Get the initial implementation on whatever is the most comfortable and just design it in a way where hosting providers can easily be swapped out.

from discordrp-mpris.

SergSel2006 avatar SergSel2006 commented on May 27, 2024

Is anyone here actually interested in being able to choose the image hosting service

not having to rely on some random host that might break/rate limit you at any monet is definitely appreciated. Get the initial implementation on whatever is the most comfortable and just design it in a way where hosting providers can easily be swapped out.

Bro my fork using host that is able to send http link after POST.
EDIT: You can change it in config. And use host per player.

from discordrp-mpris.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.