Jut.su_AchievmentsGet

Getting achievements without watching anime on jut.su

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Jut.su_AchievmentsGet
// @namespace    MeloniuM/Jut.su
// @version      0.1
// @description  Getting achievements without watching anime on jut.su
// @author       MeloniuM
// @license      MIT
// @match        https://jut.su/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=jut.su
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    $('body').ready(function(){
        if ($('.header_video.allanimevideo').length == 0) return;
        let timer = setInterval(function(){
            if (typeof (player) == "undefined") return;
            if (!player.isReady_) return;
            getAchievement();
            clearInterval(timer);
        }, 1000);

        function getAchievement(){
            let i = 0;
            player.overlays_.forEach(function(curr, index){
                if ($(curr.el()).hasClass('achievement_vjs_margin')){
                    setTimeout(() => {
                        curr.show();
                        activate_achievement(curr, curr.options_.achiv_id, curr.options_.achiv_hash);
                        console.log($(curr.el()).find('.achievement_text_style').text());
                    }, i * 5100);
                    i++;
                }
            });
        }
    });
})();