View Single Post
  #1948  
Old 22.10.2021, 05:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by reddy.shyam View Post
... download files at random
Code:
/*
    Randomize download order
    Trigger: Download controller started
*/

var index, priorities = ["HIGHEST", "HIGHER", "HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST"];

getAllDownloadLinks().forEach(function(link) {
    if (!link.finshed) {
        index = Math.floor(Math.random() * priorities.length);
        link.priority = priorities[index];
    }
})
Reply With Quote