So I'm making a DIY Youtube Shuffler because apparently Youtube can't shuffle my playlists properly. I have no experience in HTMl or APIs or anything, but I stole enough code from here to make it work. But, it maxes out at 200 videos even though my playlist is a lot longer than that (around 2500). The code is below. I know this is a limitation with the Youtube API, but is there any workaround?
<html lang="en">
<head>
<title>YouTube Shuffle!</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="https://www.youtube.com/s/desktop/94d44772/img/favicon_144x144.png" sizes="144x144">
<style>
body, html { margin: 0; padding: 0; }
</style>
</head>
<body>
<div id="player"></div>
<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
function onYouTubeIframeAPIReady() {
var numPl = Math.floor((Math.random() * 50) + 1);
var player = new YT.Player("player", {
height: '390',
width: '640',
playerVars: {
listType:'playlist',
list:'PL0mcz16a5pG0evLcpesj7g7CcFpwRhfke',
index: numPl,
autoplay: 1,
},
events: {
'onReady': function (event) {
//event.target.cuePlaylist({list: "PL0mcz16a5pG0evLcpesj7g7CcFpwRhfke"});
//event.target.playVideo();
setTimeout(function() {
event.target.setShuffle({'shufflePlaylist' : true});
}, 1000);
}
}
});
}
</script>
</body>
</html>