Pick a random captcha provider instead of params
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
d3d5296ccd
commit
98c304ccd4
|
@ -30,11 +30,16 @@ class BackgroundTask(throttle: Int, timeLimit: Int) {
|
|||
}
|
||||
|
||||
private def getRandomParam(): Parameters = {
|
||||
val level = Config.allowedLevels.toList(Config.getNextRandomInt(Config.allowedLevels.size))
|
||||
val media = Config.allowedMedia.toList(Config.getNextRandomInt(Config.allowedMedia.size))
|
||||
val inputType = Config.allowedInputType.toList(Config.getNextRandomInt(Config.allowedInputType.size))
|
||||
val captcha = pickRandom(Config.captchaConfig)
|
||||
val level = pickRandom(captcha.allowedLevels)
|
||||
val media = pickRandom(captcha.allowedMedia)
|
||||
val inputType = pickRandom(captcha.allowedInputType)
|
||||
|
||||
Parameters(level, media, inputType, Some(Size(0,0)))
|
||||
Parameters(level, media, inputType, Some(Size(0, 0)))
|
||||
}
|
||||
|
||||
private def pickRandom[T](list: List[T]): T = {
|
||||
list(Config.getNextRandomInt(list.size))
|
||||
}
|
||||
|
||||
def beginThread(delay: Int): Unit = {
|
||||
|
|
Loading…
Reference in New Issue