Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Random Values for --sleep-interval #9930

Closed
ap4125 opened this issue Jun 28, 2016 · 1 comment
Closed

Allow Random Values for --sleep-interval #9930

ap4125 opened this issue Jun 28, 2016 · 1 comment
Labels

Comments

@ap4125
Copy link

@ap4125 ap4125 commented Jun 28, 2016

The --sleep-interval option is great. I think that this is the main reason why we can run downloads from heavily monitored sites.

Is there a way to modify this option so that it can accept random values? For example, instead of setting it to --sleep-interval 300 to set it to sleep for 300 seconds or 5 minutes between each download, make it like so:

--sleep-interval 120-300

so that the sleep interval would be set between 120 and 300 seconds.

The rationale is to simulate more realistic browsing behavior.

@yan12125 yan12125 added the request label Jun 28, 2016
@ghost
Copy link

@ghost ghost commented Jul 1, 2016

Having a browse here to see what I could actually work on.
Could we approach it like this?

sleep_interval = random.randrange(int(self.params.get('sleep_interval').split('-')[0]), int(self.params.get('sleep_interval').split('-')[1]))

I guess thats not ideal because we are taking a string as input and instead we should take two ints (and upper and a lower)?

Maybe @yan12125 can provide feedback on my noob approach 👍

Edit: I suppose we could just randomize the number in sleep_interval, sending pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.