// ==UserScript== // @name Streamable Grabber // @namespace http://tampermonkey.net/ // @version 1.0 // @description The script allows users to download Streamable videos with a button and from the menu of a native video player. // @author smolag // @license GNU GPLv3 // @match *://streamable.com/* // @grant none // @run-at document-start // @downloadURL https://update.greasyfork.icu/scripts/487623/Streamable%20Grabber.user.js // @updateURL https://update.greasyfork.icu/scripts/487623/Streamable%20Grabber.meta.js // ==/UserScript== ;(function () { "use strict" const pathname = window.location.pathname const url = "https://api.streamable.com/videos" + pathname fetch(url) .then((response) => { if (!response.ok) { return Promise.reject(response) } return response.json() }) .then((data) => { const vidUrl = data.files.mp4.url const title = data.title const filename = pathname.slice(1) + "-" + title.replace(/[<>:"\/\\|?*\x00-\x1F]/g, "_").trimEnd() // Same-Origin Policy violation - the 'download' attribute is ignored document.write( `