Slightly more aggressive implementation of google_dos_protection.
This commit is contained in:
parent
d05ca9678e
commit
0ca3476b09
|
@ -13,16 +13,18 @@
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
""" Various utility methods."""
|
||||
|
||||
import sys
|
||||
from time import sleep
|
||||
from random import randint
|
||||
from random import randrange
|
||||
|
||||
|
||||
def google_dos_protection(max=2):
|
||||
sleep(randint(1, max) * .6)
|
||||
def google_dos_protection(maxrange=2):
|
||||
"""Wait a random number of seconds (between 0.5 to maxrange*0.5)
|
||||
to avoid Google's bot detection"""
|
||||
sleep(randrange(1, maxrange) * .5)
|
||||
|
||||
|
||||
def log(verbose, msg):
|
||||
|
|
Loading…
Reference in New Issue