Panopto-DL

download video from panopto

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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;
    }
`);