StreamableDownloader

Downloads the current Streamable video when the button is clicked.

目前為 2022-10-24 提交的版本,檢視 最新版本

// ==UserScript==
// @name         StreamableDownloader
// @namespace    http://tampermonkey.net/
// @version      1.0.1
// @description  Downloads the current Streamable video when the button is clicked.
// @author       Mr_Satisfaction
// @match        *://streamable.com/*
// @icon         https://cdn0.iconfinder.com/data/icons/ui-line-pixel-perfect-3/32/user_interface_UI_line_download_unduh_media_ui-512.png
// @grant        none
// @license      MIT
// ==/UserScript==

let CSS = `<style type="text/css">
.download-button {
  background-color: #222;
  border-radius: 4px;
  border-style: none;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-family: "Farfetch Basis","Helvetica Neue",Arial,sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  margin-left: auto;
  outline: none;
  overflow: hidden;
  position: relative;
  text-align: center;
  text-transform: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: 80px;
}

.download-button:hover,
.download-button:focus {
  opacity: .75;
}</style>` // Useful CSS code for button layout

function handleClick(event) { // Called when button is clicked
    let videoURL = document.getElementById('video-player-tag').getAttribute('src');
    window.location.href = videoURL; // Sends a request to the video hosting link which automatically downloads the video
}

document.head.insertAdjacentHTML("beforeend", CSS); // Inserts CSS code above
const downloadBar = document.getElementsByClassName('actions-section')[0]
const btn = document.createElement('button'); // Creates the button
btn.setAttribute('class', 'download-button'); // Settings up the button
btn.textContent = 'Download';
downloadBar.style.display = 'flex';
downloadBar.style.width = 'auto'
downloadBar.appendChild(btn); // Adds the button to the actions-section bar

btn.addEventListener('click', handleClick); // Calls handleClick() when button is clicked

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址