sll552 / DiscordBee

MusicBee plugin that updates your Discord status with the currently playing track
Apache License 2.0
421 stars 31 forks source link

Allow us to use an Imgur account + our own "application" to have our own independent rate limit #145

Closed Rings4 closed 2 years ago

Rings4 commented 2 years ago

Using an anonymous imgur account means you cannot delete anything that is uploaded. Using an account would give us the ability to delete artwork, for whatever reason we may want to do so.

As for rate limits, I think doing something similar to using our own Discord App ID where we use our own Imgur App ID (or however that works for imgur) would give us independence from others and prevent the rate limit from being reached by other people.

sll552 commented 2 years ago

I wanted to keep it simple, so no requirement for an account and no need to implement the Oauth flow. I currently don't see a reason to delete the artwork, but if one arises this would be a solution. Because tracking of the deletionHashes (when an image gets uploaded the response contains a hash which can be used to delete it) could be error prone but would still be easier.

The topic of rate limits is also more complex than it seems as there are actually two different limits. One is per IP and one is per Application. So a different Imgur App ID would only help for the second limit, the per IP limit would still hit.

RegorForgot commented 2 years ago

If you are having rate limit issues and have not passed the "50 uploads/hr" IP limit then you can:

  1. create your own application on the Imgur API (No callback URL works fine) image image

  2. clone the DiscordBee Repository

  3. change the client ID on line 87 of DiscordBee.cs (default is "34debbc0ae4077e") image

  4. build the application using the default built event and replace all necessary files in your MusicBee/Plugins folder

BobbyWibowo commented 2 years ago

Lmao yeah, had to do just that myself First time using it for the day, and the hard-coded client already reported as unhealthy straight away on my end

Rings4 commented 2 years ago

The topic of rate limits is also more complex than it seems as there are actually two different limits. One is per IP and one is per Application. So a different Imgur App ID would only help for the second limit, the per IP limit would still hit.

I know lol that's exactly why I suggested you allow us to use our own application ID. So we don't encounter the second limit.

sll552 commented 2 years ago

I actually didn't think that the limit would be hit that much after the initial storm when the new upload releases. It's about 1250 uploads per day, so actually not a small amount. I guess I underestimated either the usercount of this plugin, or the number of different albums 😅

I will take a look at adding a more comfortable option than recompiling.

Rings4 commented 2 years ago

Sounds good! Most people don't listen to entire albums at a time so you'll easily find the limit being reached. I listen to 80 songs a day on average and sometimes they're playlist shuffles of my top rated songs, meaning 80 tracks with unique artwork.