File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -528,8 +528,13 @@ const downloadCourse = async (courseJSON, startingVideoId) => {
528
528
let maxDuration = await readMaxDuration ( )
529
529
// Sleep for minimum duration btw the time with percent and the max duration time
530
530
if ( maxDuration != 0 ) {
531
- CURRENT_INTERVAL = updateWaitStats ( Math . min ( duration * 10 * speed , maxDuration * 1000 ) )
532
- CURRENT_SLEEP = sleep ( Math . min ( duration * 10 * speed , maxDuration * 1000 ) )
531
+ log ( `maxDuration: ${ maxDuration } duration: ${ duration } speed: ${ speed } ` , "INFO" )
532
+ maxDuration = Math . floor ( Math . random ( ) * ( maxDuration - Number ( speed ) ) + Number ( speed ) )
533
+ CURRENT_INTERVAL = updateWaitStats ( maxDuration * 1000 )
534
+ CURRENT_SLEEP = sleep ( maxDuration * 1000 )
535
+ // CURRENT_INTERVAL = updateWaitStats(Math.min(duration * 10 * speed, maxDuration * 1000))
536
+ // CURRENT_SLEEP = sleep(Math.min(duration * 10 * speed, maxDuration * 1000))
537
+ log ( `Sleeping for ${ maxDuration } seconds...` , "INFO" )
533
538
await CURRENT_SLEEP
534
539
CURRENT_INTERVAL . abort ( )
535
540
}
You can’t perform that action at this time.
0 commit comments