Sleazy Fork is available in English.

unlock lpsg videos

unlock lpsg video access. may need to manually switch video format since I can't figure out a way to find it. Also load all images ASAP instead of having to scroll to them.

// ==UserScript==
// @name         unlock lpsg videos
// @namespace    MBing
// @version      3.0
// @description  unlock lpsg video access. may need to manually switch video format since I can't figure out a way to find it. Also load all images ASAP instead of having to scroll to them.
// @author       MBing
// @match        https://www.lpsg.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license            MIT
// ==/UserScript==

(function() {
    'use strict';

    var easterEggPoster = document.getElementsByClassName("video-easter-egg-poster");
    var volume=0.1;
    var videoDiv=[];
    var imageUrl;
    var videoUrl;
    var newDiv;
    for (var i=easterEggPoster.length-1;i>-1;i--){
        imageUrl =easterEggPoster[i].children[0].src;
        videoUrl=imageUrl.replace("attachments/posters","video").replace("/lsvideo/thumbnails","lsvideo/videos").replace(".jpg",".mp4");
        videoDiv[i]=`<video onloadstart="this.volume=${volume}" style="width:750px; max-height: 750px;" controls=\"\" data-xf-init=\"video-init\" data-poster=\"${imageUrl}\" class=\"\" style=\"\" poster=\"${imageUrl}\"><source data-src=\"${videoUrl}\" src=\"${videoUrl}\"><div class=\"bbMediaWrapper-fallback\">Your browser is not able to display this video.</div></video>`;
        //void(easterEggPoster[i].innerHTML=videoDiv[i]);

        newDiv = document.createElement("div");
        newDiv.setAttribute("class","newVideoDiv");
        newDiv.innerHTML=videoDiv[i];
        easterEggPoster[i].parentElement.parentElement.append(newDiv);

        easterEggPoster[i].parentElement.parentElement.append(createButton("mov",i));
        easterEggPoster[i].parentElement.parentElement.append(createButton("m4v",i));
        easterEggPoster[i].parentElement.parentElement.append(createButton("mp4",i));
    }

    for (i=easterEggPoster.length-1;i>-1;i--){
        easterEggPoster[i].parentElement.parentElement.removeChild(easterEggPoster[i].parentElement);
    }

    var easterEggBlocker = document.getElementsByClassName("video-easter-egg-blocker");
    for (i=easterEggBlocker.length-1;i>-1;i--){
        easterEggBlocker[i].parentElement.removeChild(easterEggBlocker[i]);
    }

    var easterEggOverlay = document.getElementsByClassName("video-easter-egg-overlay");
    for (i=easterEggOverlay.length-1;i>-1;i--){
        easterEggOverlay[i].parentElement.removeChild(easterEggOverlay[i]);
    }

    var allVideoPlayers = document.getElementsByTagName('video');
    for (i=allVideoPlayers.length-1;i>-1;i--){
        allVideoPlayers[i].volume = volume;
    }

    //直接加载所有图片
    document.querySelectorAll('img[loading="lazy"]').forEach(img => img.loading = 'eager');

    function createButton(format,entryId){
        var inp;
        inp = document.createElement("input");
        inp.type = "button";
        inp.value = format;
        inp.id = entryId;
        inp.addEventListener('click', function () {
            var oldUrl = document.getElementsByClassName("newVideoDiv")[this.id].innerHTML;
            document.getElementsByClassName("newVideoDiv")[this.id].innerHTML=oldUrl.replaceAll("mp4",format).replaceAll("m4v",format).replaceAll("mov",format);
        });
        return inp;
    }

})();