Skip to content

Instantly share code, notes, and snippets.

@pixelcrisis
Created October 12, 2023 01:27
Show Gist options
  • Save pixelcrisis/aae8229b4a3ec1af08d0aba551f2c5ec to your computer and use it in GitHub Desktop.
Save pixelcrisis/aae8229b4a3ec1af08d0aba551f2c5ec to your computer and use it in GitHub Desktop.
DeepCut AutoSkip Broken Tracks
(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