``` // ==UserScript== // @name SL // @version 4 // @grant none // @match https://www.sexlog.com/u/* // @match https://www.sexlog.com/go/* // @match https://www.sexlog.com/videos // @match https://www.sexlog.com/videos?page=* // @match https://www.sexlog.com/*/livecam // @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js // ==/UserScript== var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; var observer = new MutationObserver(function(mutations) { setTimeout(function () { var aba = window.location.href; if (aba.search("livecam") > 23) { var usuario = document.getElementsByClassName("livecam-room-header__title")[0].childNodes[1].children[0].attributes[2].value; var URL = "https://www.sexlog.com/service/livecam/init/" + usuario; var hora = new Date(); var youtube_dl_filename = usuario + " " + ( hora.getDate() <10?'0':'') + hora.getDate() + "-" + ( (hora.getMonth() + 1) <10?'0':'') + (hora.getMonth() + 1) + "-" + hora.getFullYear() + " " + ( (hora.getHours() + 1) <10?'0':'') + hora.getHours() + "_" + ( (hora.getMinutes() + 1) <10?'0':'') + hora.getMinutes() + "_" + ( (hora.getSeconds() + 1) <10?'0':'') + hora.getSeconds() + ".mp4"; $.getJSON(URL, function(d) { var dummy = document.createElement("a"); var live = d.player.url.HTML dummy.text = youtube-dl "${live.toString()}" -o "${youtube_dl_filename}" --no-part --retries 50; dummy.className = "youtube_dl" if (!document.querySelector(".youtube_dl")) { document.body.appendChild(dummy); botao_youtube_dl(); }; console.log(youtube_dl_filename); console.log(live.toString()); }); }; $( ".play" ).remove(); $( "div.spinner" ).remove(); $( ".sl-safe-watermark" ).remove(); teste(); botaodownload(); }, 5000); }); function teste () { setTimeout(function () { botaodownload2(); } , 50); }; function botao_youtube_dl () { var botaolinks = document.createElement('div'); botaolinks.innerHTML = " "; botaolinks.style = "height: auto; width: auto; position:absolute; right: 45%; top: 2%; font-size: 50px"; document.getElementsByClassName("livecam-room-header__transmission-data transmission-data")[0].append(botaolinks); var script = document.createElement('script'); var youtube_dl = document.getElementsByClassName("youtube_dl")[0].textContent script.type = "text/javascript"; script.innerHTML = ` function pegarlinks () { var dummy2 = document.createElement("input"); document.body.appendChild(dummy2); dummy2.setAttribute("id", "dummy_id"); document.getElementById("dummy_id").value=document.getElementsByClassName("youtube_dl")[0].textContent; dummy2.select(); document.execCommand("copy"); document.body.removeChild(dummy2); alert("Link copiado, use no youtube-dl."); };` document.getElementsByClassName("livecam-room-header__transmission-data transmission-data")[0].appendChild(script); }; observer.observe(document.body, {childList: true}); function botaodownload () { let link_1 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.search(",\"filename\":"); let link_2 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.search(",\"sources\":"); let link_3 = link_1 + 44; let link_4 = (link_2 - 1) - link_3; let mp4 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.substr(link_3, link_4); if (mp4.length > 400) { link_1 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.search(",\"sources\":"); link_2 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.search(",{\"src\":null}]"); link_3 = link_1 + 51; link_4 = (link_2 - 2) - link_3; mp4 = document.getElementsByClassName("profile-gallery-details ng-scope")[0].attributes[2].value.substr(