Skip to content

Instantly share code, notes, and snippets.

@M-rcus
Last active August 28, 2022 16:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9 to your computer and use it in GitHub Desktop.
Save M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Sproutvideos (*.vids.io) - Get video embed URL.
// @namespace github.com/M-rcus
// @match https://*.vids.io/videos/*
// @grant none
// @version 1.4.0
// @author Marcus
// @description Gets the video embed URL for Sproutvideo.
// @updateUrl https://gist.github.com/M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9/raw/sproutvideo.user.js
// @downloadUrl https://gist.github.com/M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9/raw/sproutvideo.user.js
// ==/UserScript==
window.addEventListener('load', () => {
const player = document.querySelector('.sproutvideo-player');
if (!player)
{
return;
}
const url = player.src;
const container = document.querySelector('.video-title h1');
const html = `<p>Embed URL: <a href="${url}" target="_blank">${url}</p>`;
container.insertAdjacentHTML('afterend', html);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment