您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a simple Download button to save LectureTube videos with one click
// ==UserScript== // @name LectureTube Downloader - tuwien.ac.at // @namespace Violentmonkey Scripts // @match https://oc-presentation.ltcc.tuwien.ac.at/engage/theodul/ui/core.html // @grant none // @version 1.0 // @author - // @description Adds a simple Download button to save LectureTube videos with one click // @require https://code.jquery.com/jquery-3.4.1.min.js // ==/UserScript== $(document).ready(function () { const timer = setInterval(function () { const videoRefs = document.getElementsByTagName('video'); const controlButtons = document.getElementById('dropdownControlsButtons'); if (videoRefs.length > 0 && controlButtons) { clearInterval(timer); const videoSrc = videoRefs[0].currentSrc; const videoType = videoSrc.substring(videoSrc.lastIndexOf('.'), videoSrc.length); const videoTitle = document.getElementById('engage_basic_description_title').innerHTML + videoType; controlButtons.appendChild(createDownloadButton(videoSrc, videoTitle)); } }, 5000); }); function createDownloadButton(src, title) { const button = document.createElement('a'); button.setAttribute('class', 'btn btn-default'); button.setAttribute('href', src); button.setAttribute('type', 'button'); button.setAttribute('download', title); button.innerHTML = 'Download'; return button; }