Skip to content

Conversation

@evaz1995
Copy link

Hello,

I noticed that the Dearrow plugin does not properly work when the API for Dearrow throws a 404 error, even when the embedded link is indeed a Youtube video. Hence I am proposing this change: if no title nor thumbnail is provided by the main API, the thumbnail API is used instead, which should provide a response for all YouTube videos unless the API is down.

@Vendicated
Copy link
Owner

Hi!
The way the plugin currently works is that it will only replace the thumbnail if the replacement has at least one upvote. I think this was done to only use manually created replacements.
I am not opposed to also using automatic replacements but I think many people probably don't want these. We should make it configurable with a new setting, defaulting to false

Besides that, it'd be much better if you refactored your changes so that it won't use a failed request's response as if it succeeded, that's asking for trouble! Something like the following would be much more robust

const res = await fetch(normalApi);
if (res.ok) {
	// existing code ...
} else if (settings.store.useAutomaticThumbnails) {
	const res = await fetch(thumbnailApi);
	// ...
}

Besides that I do like this idea, so thank you!

description: "Makes YouTube embed titles and thumbnails less sensationalist, powered by Dearrow",
authors: [Devs.Ven],
authors: [Devs.Ven, {
name: "ichi0995",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add yourself to the devs export like how devs.ven is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants