ByzantineFailure / BPM-for-Discord

BPM for Discord's Desktop App. Includes one-click installers, update notifications, and custom script support.
GNU Affero General Public License v3.0
17 stars 8 forks source link

Discord blocks requests to emote image hosts (s3) #102

Open ByzantineFailure opened 6 years ago

ByzantineFailure commented 6 years ago

Currently in the canary request to s3, where the emotes are hosted, are blocked and will not go through. This hard breaks BPM.

After bandying about a few solutions, I think the best solution is:

  1. When an emote is found, send a message to the backend with the image url of the emote.
  2. Have the backend make that request from the Electron layer rather than from the frontend. Use a cache here and do not re-request unless necessary.
  3. Replace the url or background-image w/ url with a base-64 version of it in the frontend CSS.

Do this on a per-emote basis. We'll lose some cache capability built-in from chromium, but things will work again.

Other options include potentially rehosting all the images on Discord, but that is a srsbsns abuse of their platform and will likely lead to a Bad End.

ByzantineFailure commented 6 years ago

Working prototype written over the weekend. Needs cleanup but we have a viable path forward.

ByzantineFailure commented 6 years ago

This methodology is unusably slow and non-performant under real-life circumstances (hangs discord for several minutes upon entering a server with many emotes).

At this point, I don't have the energy to pursue different solutions. If someone submits a working commit to me I'll hand over ownership of the repo to them as I don't have the capability of keeping up with the needs of this project anymore.

CrystalSplitter commented 6 years ago

It's a shame that this method didn't succeed. I hope this doesn't lead to the end of BPM on discord, but I'm not sure of a way out unless you want to only use the browser version.