您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
when track goes into last seconds, it will stop
// ==UserScript== // @name Soundcloud - stop autoplay tracks // @namespace http://tampermonkey.net/ // @version 0.1 // @description when track goes into last seconds, it will stop // @author https://puvox.software // @match https://*.soundcloud.com/* // @icon https://www.google.com/s2/favicons?domain=soundcloud.com // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const stopWithinSecondsLast = 3; function hmsToSecondsOnly(str) { var p = str.split(':'), s = 0, m = 1; while (p.length > 0) { s += m * parseInt(p.pop(), 10); m *= 60; } return s; } const intervalCheck = setInterval ( ()=> { const playingState = document.querySelector('.playControls__play.playing'); if (playingState) { const currentTimeElement = document.querySelector('.playbackTimeline__timePassed [aria-hidden="true"]'); const currentTimeSeconds = hmsToSecondsOnly(currentTimeElement.textContent); const fullDurationElement = document.querySelector('.playbackTimeline__duration [aria-hidden="true"]'); const fullTimeSeconds = hmsToSecondsOnly(fullDurationElement.textContent); if (fullTimeSeconds-currentTimeSeconds < stopWithinSecondsLast) { try { playingState.click(); } catch(e){} } } }, 1000); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址