Stream CDA videos in VLC

Watch videos from cda.pl in VLC media player

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Stream CDA videos in VLC
// @name:pl         Streamuj filmy z CDA w VLC
// @description     Watch videos from cda.pl in VLC media player
// @description:pl  Ogladaj filmy z cda.pl w odtwarzaczu VLC
// @version         1.0
// @author          SerpentDash
// @include         /https?:\/\/(ebd|www)?\.cda\.pl\/(video|[0-9a-z]+)\/[0-9]+.+/
// @grant           GM_xmlhttpRequest
// @run-at          document-end
// @namespace       https://greasyfork.org/users/702655
// ==/UserScript==

// [EN] Script create file that can be opened in VLC to stream videos from cda.pl and ebd.cda.pl (others media player that can stream should work too)
// After you click new button (top right corner of player) click "Open as" VLC

// [PL] Skrypt tworzy plik, ktory mozna odtworzyc w VLC aby streamowac filmy z cda.pl oraz ebd.cda.pl (inne odtwarzacze umozliwiajace streamowanie rowniez powinny zadzialac)
// Po wcisnieciu nowego przycisku (gorny prawy rog odtwarzacza) wcisnij "Otworz za pomoca" VLC

(function () {
    let vid = document.getElementsByClassName("pb-video-player")[0];
    let btn = document.createElement("a");
    btn.text = '\u229A'; // icon
    btn.href = 'data:video/mp4,' + vid.src;
    btn.download = vid.ownerDocument.title;
    btn.setAttribute("style", 'font-size: 30px; color: white; padding: 10px 10px; opacity: 0.3; position: absolute; z-index: 10; top: 0; right: 0; line-height: .8;');
    (document.URL.match("www.cda.pl") ? document.getElementsByClassName("wplayer")[0] : document.body).appendChild(btn);
})();