您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Script that turns power ON/OFF in my amplituner (with autohotkey http server) automatically with spotify play/pause. For this script browser has to allow mixed content (https spotify vs http autohotkey server)
// ==UserScript== // @name Spotify & Amplituner Power Auto // @version 1.0.4 // @description Script that turns power ON/OFF in my amplituner (with autohotkey http server) automatically with spotify play/pause. For this script browser has to allow mixed content (https spotify vs http autohotkey server) // @match https://open.spotify.com/* // @author verona (lukchojnicki) // @namespace https://gf.qytechs.cn/users/164173 // ==/UserScript== var prevState = 1; // 1 = play, 0 = pause setInterval(function () { if (!document.getElementsByClassName('connect-bar').length) { // playing on this device if (document.getElementsByClassName('spoticon-pause-16').length) { // now playing if (prevState === 0) { console.log('turn ON AMP power'); ampPower(1); } prevState = 1; } else if (document.getElementsByClassName('spoticon-play-16').length) { // paused if (prevState === 1) { console.log('turn OFF AMP power'); ampPower(0); } prevState = 0; } } }, 1000); function ampPower(status) { var xhttp = new XMLHttpRequest(); if (status) { xhttp.open('GET', 'http://localhost:8000/ampon', true); } else{ xhttp.open('GET', 'http://localhost:8000/ampoff', true); } xhttp.send(); }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址