// ==UserScript== // @name Panopto-Video-DL // @namespace www.pizidavi.altervista.org // @description Download video from Panopto // @icon https://www.panopto.com/wp-content/themes/panopto/library/images/favicons/favicon-96x96.png // @author pizidavi & Stini // @version 2.0 // @copyright 2021, PIZIDAVI // @license MIT // @homepageURL https://github.com/enricobragastini/Panopto-Video-DL // @match https://*.panopto.com/Panopto/Pages/Viewer.aspx?*id=* // @match https://*.panopto.eu/Panopto/Pages/Viewer.aspx?*id=* // @match https://*.panopto.com/Panopto/Pages/Embed.aspx?*id=* // @match https://*.panopto.eu/Panopto/Pages/Embed.aspx?*id=* // @grant none // @downloadURL none // ==/UserScript== (function(Panopto) { 'use strict'; if (location.pathname.includes('Viewer.aspx')) { const element = document.createElement('a'); element.id = 'downloadTabHeader'; element.classList = 'event-tab-header'; element.href = location.pathname.replace('Viewer.aspx', 'Embed.aspx') + '?id=' + new URLSearchParams(location.search).get('id'); element.target = '_blank'; element.style = 'position:absolute;bottom:40px;padding:5px 10px;cursor:pointer;'; element.innerHTML = 'Download file_download'; element.addEventListener('click', e => { const div = document.createElement('div'); div.id = 'Panopto-Video-DL'; div.innerHTML = '

Warning!

Panopto has blocked the previous download method!

To download video follow these steps:

  1. Download this Python program: Download
  2. Click on "Download" button in the bottom-left corner
  3. Wait until the page opened is automatically closed
  4. Open the program and paste automatically copied link
  5. Wait until the download finishes
  6. The video will be found in the same folder of the program

'; document.querySelector('body').appendChild(div); setTimeout(() => { div.querySelector('button').disabled = false; }, 5*1000); }); document.querySelector('#eventTabControl').appendChild(element); } else if (location.pathname.includes('Embed.aspx')) { const master_url = Panopto.Embed.instance.videoUrl; copy_in_clipboard(master_url); window.close(); } // Function function copy_in_clipboard(text) { const input = document.querySelector('input'); input.type = 'text'; input.value = text; input.select(); input.setSelectionRange(0, 99999); document.execCommand('copy'); input.remove(); } })(Panopto);