From 69cc84771560b703810ced0892928bf90d04952d Mon Sep 17 00:00:00 2001 From: barbequesauce Date: Wed, 15 Mar 2017 13:19:19 -0400 Subject: [PATCH] Add random delay to avoid DDOS protection Add random delay to avoid DDOS protection (per issue 1571) --- mylar/rsscheck.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mylar/rsscheck.py b/mylar/rsscheck.py index 61d1a198..b70f0e98 100755 --- a/mylar/rsscheck.py +++ b/mylar/rsscheck.py @@ -10,6 +10,7 @@ import ftpsshup import datetime import gzip import time +import random from StringIO import StringIO import mylar @@ -145,6 +146,9 @@ def torrents(pickfeed=None, seriesname=None, issue=None, feedinfo=None): if all([pickfeed != '4', pickfeed != '3', pickfeed != '5', pickfeed != '999']): payload = None +            ddos_protection = round(random.uniform(0,15),2) +            time.sleep(ddos_protection) + try: cf_cookievalue = None scraper = cfscrape.create_scraper()