igorok107 / LostFilm.unblock

// ==UserScript==
// @name         LostFilm.unblock
// @namespace    Igorok107
// @author       Igorok107
// @description  Скачивание заблокированных серий без использования прокси.
// @updateURL    https://openuserjs.org/meta/igorok107/LostFilm.unblock.meta.js
// @downloadURL  https://openuserjs.org/src/scripts/igorok107/LostFilm.unblock.user.js
// @version      0.1.1
// @match        *://*.lostfilm.tv/series/*/season*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var btn = $("div.external-btn2");
    if (btn.length !== 0) {
        if ($("div.main_poster").length !== 0){
            var data = $(btn).parent().find("div.mark-rate-pane").attr("rel").split(",");
            $(btn).removeClass("external-btn2").addClass("external-btn");
            $(btn).attr("onclick","PlayEpisode('"+data[0]+"','"+data[1]+"','"+data[2]+"')");
        } else {
            var seasons = $("table.movie-parts-list");
            $.each(seasons,function(i,season){
                var dnSeason = $(season).parent().find("div.movie-details-block").find("div.haveseen-btn").attr("data-code");
                if (dnSeason != undefined){
                    dnSeason = dnSeason.split("-");
                    var b = $(season).parent().find("div.movie-details-block").find("div.external-btn2");
                    $(b).removeClass("external-btn2").addClass("external-btn");
                    $(b).attr("onclick","PlayEpisode('"+dnSeason[0]+"','"+dnSeason[1]+"','999')");
                }
                var series = $(season).find("div.haveseen-btn");
                $.each(series,function(i,ser){
                    var dataStr = $(ser).attr("data-code");
                    if (dataStr == undefined) return true;
                    var data = dataStr.split("-");
                    b = $(ser).parent().parent().find("div.external-btn2");
                    $(b).removeClass("external-btn2").addClass("external-btn");
                    $(b).attr("onclick","PlayEpisode('"+data[0]+"','"+data[1]+"','"+data[2]+"')");
                });
            });
        }
    }
})();