Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoplay MP4 files linked in chat messages from sources like imgur #51

Open
frnknstn opened this issue Nov 8, 2024 · 2 comments
Open

Comments

@frnknstn
Copy link
Contributor

frnknstn commented Nov 8, 2024

Sometimes Imgur URLs in chat messages like https://imgur.com/jYzz48v can be MP4 videos, not just a static images. It would be great to detect and automatically play these videos.

@frnknstn
Copy link
Contributor Author

frnknstn commented Nov 8, 2024

I notice that RoadHog321's tampermonkey script has this feature. Unfortunately my JavaScript skills are too weak to add this feature myself. https://raw.githubusercontent.com/road-hog123/significantly-less-nifty-chat/master/chat-monitor.user.js

async function getImgurLink(album, identifier) {
    var apiLink = ((album) ? `https://api.imgur.com/3/album/${identifier}/images` : `https://api.imgur.com/3/image/${identifier}`);
    var content = await ((await fetch(apiLink, { "headers": { "Authorization": "Client-ID db1c3074b0b7efc" } })).json());
    return ((album) ? content.data[0].link : content.data.link);
}

@frnknstn
Copy link
Contributor Author

frnknstn commented Nov 8, 2024

...after looking some more, I see the first step is to add video support :)

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

No branches or pull requests

1 participant