Created
October 12, 2023 01:27
-
-
Save pixelcrisis/aae8229b4a3ec1af08d0aba551f2c5ec to your computer and use it in GitHub Desktop.
DeepCut AutoSkip Broken Tracks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (!window.turntable) return alert("Not Loaded, Try Again."); | |
else console.log("Auto-Skip Initiated."); | |
const look = function (event) { | |
let src = window.youtube?.player?.[0]; | |
if (!src) return console.log("Auto-Skip: Not Youtube."); | |
let can = src.getPlayerState(); | |
if (can == "-1") return setTimeout(skip, 1000); | |
}; | |
const skip = function () { | |
console.log("Auto-Skip: Skipping..."); | |
let view = window.turntable.topViewController.roomView; | |
let data = { | |
api: "room.stop_song", | |
roomid: view.room.roomId, | |
djid: view.currentDj.userId, | |
songid: window.turntable.current_songid | |
}; | |
window.turntable.sendMessage(data) | |
}; | |
window.turntable.addEventListener("message", event => { | |
if (!event.command || event.command != "newsong") return; | |
return setTimeout(look, 1000); | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment