Greasy Fork

animepahe autoplay

Autoplay feature for Animepahe

目前为 2024-11-19 提交的版本。查看 最新版本

// ==UserScript==
// @name animepahe autoplay
// @namespace https://gist.github.com/lemonadeforlife/95cdde5ba4333ec26fbc6fe1f206928c
// @version 2.0
// @description Autoplay feature for Animepahe
// @author lemonade_for_life
// @match https://animepahe.ru/play/*
// @include https://kwik.si/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=animepahe.ru
// @grant        none
// @license Unlicense
// ==/UserScript==
target = document.querySelector('.click-to-load');
video_player = document.querySelector("#kwikPlayer");
function check(changes, observer) {
  if(target!=null) {
    target.click();
  } else if (video_player!=null && document.querySelector('.plyr__poster')!=null){
    observer.disconnect();
    video_player.play();
    video.player.focus();
  }
}
const observer = new MutationObserver(check);
const config = {childList: true, subtree: true};
observer.observe(document, config)