Panopto-DL

download video from panopto

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Panopto-DL
// @namespace    https://scripts.lirc572.com/
// @version      0.2
// @description  download video from panopto
// @author       lirc572
// @match        https://*.panopto.com/Panopto/Pages/Viewer.aspx?id=*
// @grant        GM_addStyle
// ==/UserScript==

function pdlDownload() {
  const metas = document.getElementsByTagName('meta');
  for (let i = 0; i < metas.length; i++) {
    if (metas[i].getAttribute('name') == 'twitter:player:stream') {
      const videoUrl = metas[i].getAttribute('content').split('?')[0];
      console.log(videoUrl);
      window.open(videoUrl);
    }
  }
}

(function () {
  const btnNode = document.createElement('div');
  btnNode.setAttribute('id', 'pdl-container');
  btnNode.innerHTML = '<button id="pdl-btn">'
    + 'Download'
    + '</button>';
  document.body.appendChild(btnNode);
  document.getElementById("pdl-btn").addEventListener(
    "click", pdlDownload, false
  );
})();

GM_addStyle(`
    #pdl-container {
        position:               absolute;
        bottom:                 5px;
        left:                   5px;
        opacity:                0.8;
        z-index:                1100;
    }
    #pdl-btn {
        cursor:                 pointer;
        border:                 none;
        background:             orange;
        font-size:              20px;
        color:                  white;
        padding:                5px 5px;
        text-align:             center;
    }
`);