// ==UserScript== // @name Pobieranie z CDA.pl // @namespace https://www.cda.pl // @version 3.1 // @description Dodaje przycisk do pobierania filmu na stronie cda.pl i w osadzonych odtwarzaczach // @author Kizior // @match http*://www.cda.pl/video/* // @match http*://ebd.cda.pl/* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; /*if(window.location.href.slice(0,25) != "https://www.cda.pl/video/" && window.location.href.slice(0,23) != "https://m.cda.pl/video/") {alert("To nie jest cda.pl, sorry"); return;} if(document.getElementById("pobieraniezcda") != null) {alert("Już masz otwarte okienko"); return;}*/ var okienko = document.createElement("div"); okienko.style.position="fixed"; okienko.style.backgroundColor="#050505"; okienko.style.width="300px"; okienko.style.height="150px"; okienko.style.zIndex="1000000"; okienko.style.top="50%"; okienko.style.left="50%"; okienko.style.transform="translate(-50%,-50%)"; okienko.style.textAlign="center"; okienko.style.borderRadius="5px"; okienko.style.border="dashed 2px darkorange"; okienko.style.padding="2px"; okienko.style.fontSize="12px"; okienko.style.color="#BBB"; okienko.style.lineHeigh="1.25"; okienko.style.fontFamily="Arial,Helvetica,sans-serif"; okienko.id="pobieraniezcda"; var tytul = document.createElement("span"); tytul.innerHTML="Pobieranie z CDA.pl
by Kizior
Wybierz jakość filmu:"; var miejsceNaPrzyciski = document.createElement("div"); miejsceNaPrzyciski.style.position="relative"; miejsceNaPrzyciski.style.top="40%"; miejsceNaPrzyciski.style.transform="translate(0,-100%)"; var napisLadowania = document.createElement("div"); napisLadowania.innerHTML="Ładowanie..."; napisLadowania.style.position="relative"; napisLadowania.style.top="20%"; napisLadowania.style.display="none"; var przyciskWyjscia = document.createElement("div"); przyciskWyjscia.style.position="absolute"; przyciskWyjscia.innerHTML="X"; przyciskWyjscia.style.right="0"; przyciskWyjscia.style.top="0"; przyciskWyjscia.style.color="red"; przyciskWyjscia.style.backgroundColor="lightgrey"; przyciskWyjscia.style.fontWeight="bold"; przyciskWyjscia.style.margin="1%"; przyciskWyjscia.style.padding="2%"; przyciskWyjscia.style.cursor="default"; przyciskWyjscia.style.width="10px"; przyciskWyjscia.style.height="10px"; przyciskWyjscia.style.lineHeight="10px"; przyciskWyjscia.style.border="dotted 2px green"; przyciskWyjscia.style.MozUserSelect="none"; var przyciskWOkienku = document.createElement("button"); przyciskWOkienku.style.padding="2%"; przyciskWOkienku.style.margin="1%"; przyciskWOkienku.style.borderRadius="10%"; przyciskWOkienku.style.fontSize="20px"; przyciskWOkienku.style.fontWeight="bold"; przyciskWOkienku.style.backgroundColor="darkgray"; przyciskWOkienku.style.color="#404040"; przyciskWOkienku.style.borderColor="orange"; przyciskWOkienku.style.fontFamily="Arial,Helvetica,sans-serif"; if(document.getElementsByClassName("areaquality").length==0) { if(document.getElementById("naglowek")!=null) { document.getElementById("naglowek").parentNode.parentNode.parentNode.innerHTML+=('
'); document.getElementById("naglowek").parentNode.parentElement.style.width = "480px"; } else { document.getElementsByClassName("quality")[0].innerHTML+=('
'); } } document.getElementsByClassName("areaquality")[0].firstElementChild.innerHTML+='Pobierz'; document.getElementById("przyciskPobierania").addEventListener("click", otworzOkno); function otworzOkno() { document.getElementsByTagName("body")[0].appendChild(okienko); } var przyciskiJakosciowe = document.getElementsByClassName("quality-btn"); var wersjeJakosciowe = new Array(); for(var i = 0; i..."; //miejsceNaPrzyciski.style.display="none"; napisLadowania.style.display="block"; var daneFilmu; $.get( adres, function( data ) { daneFilmu=$.parseJSON($(data).find("#mediaplayer" + wideoID).attr("player_data")); napisLadowania.innerHTML = " Pobierz (" + jakosc + ")
Kliknij prawym przyciskiem myszy i wybierz \"Zapisz link jako\""; }); } function rot13(str) { var input = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; var output = 'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'; var index = x => input.indexOf(x); var translate = x => index(x) > -1 ? output[index(x)] : x; return str.split('').map(translate).join(''); } function decodeCDAURL(str) { var decodedUrl = decodeURIComponent(str); var completeUrl = ""; for(var i = 0; i