I have written a script you can use to download all images from the riot cdn. It saves all images locally with a delay of 500ms per image. It also skips those where the current number is not an image. Just add the script to a html page and open it in the browser :)
const url = "https://ddragon.leagueoflegends.com/cdn/13.9.1/img/profileicon/";
const ext = ".png";
for (let i = 0; i < 6000; i++) {
setTimeout(function() {
const img = new Image();
img.crossOrigin = 'Anonymous';
img.src = url + i + ext;
img.onload = function() {
const canvas = document.createElement('canvas');
canvas.width = this.naturalWidth;
canvas.height = this.naturalHeight;
const ctx = canvas.getContext('2d');
ctx.drawImage(this, 0, 0);
canvas.toBlob(function(blob) {
saveAs(blob, 'image' + i + ext);
})
}
img.onerror = function() {
console.log('Image not found: ' + this.src);
};
}, i * 500);
}
You could also add some more logic to get the most current api version. You get it from this url: https://ddragon.leagueoflegends.com/api/versions.json
And receive a json width a "data" array that on [0] has the newest api version.