您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自動觀看動畫瘋廣告
当前为
// ==UserScript== // @name 動畫瘋-自動觀看廣告 // @namespace https://shinoharahare.github.io/ // @version 0.1 // @description 自動觀看動畫瘋廣告 // @author Hare // @match https://ani.gamer.com.tw/animeVideo.php?sn=* // @grant none // ==/UserScript== (async () => { 'use strict'; if (await checkAD()) { (await waitElement('#adult')).click() const video = document.querySelector('video[title=Advertisement]') video.addEventListener('play', ({ target }) => { target.muted = true }) await sleep(30000) videojs.getPlayer('ani_video').trigger('vast.adSkip') location.reload() } })(); async function checkAD() { const res = await fetch(`/ajax/token.php?sn=${animefun.videoSn}`) const json = await res.json() return json.time == 0 } async function waitElement(selector) { return await wait(() => document.querySelector(selector)) } function wait(tester, timeout, delay = 100) { return new Promise((resolve, reject) => { const interval = setInterval(() => { const result = tester() if (result) { clearInterval(interval) resolve(result) } }, delay) if (timeout) { setTimeout(() => { clearInterval(interval) reject() }, timeout) } }) } function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)) }