Skip to content

Commit

Permalink
v1.5
Browse files Browse the repository at this point in the history
1. increased the maximum delay time between requests from 30 to 60 seconds
2. blacklist updated
3. the number of threads became 2 by default
  • Loading branch information
deedy5 authored Sep 28, 2021
1 parent 9842359 commit 24219be
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions fake_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
from google_searching import ggl
from google_trends import realtime_trends

__version__ = '1.4'
__version__ = '1.5'

THREADS = 1
THREADS = 2
MIN_WAIT = 1
MAX_WAIT = 30
MAX_WAIT = 60
DEBUG = False

BLACKLIST = (
"bit.ly", "clickserve", "https://t.co", "itunes.apple.com", "javascript:",
"l.facebook.com", "login", "Login", "mail.", "mailto:", "mediawiki",
"messenger.com", "policies", "s.click", "showcaptcha?", "signup",
"l.facebook.com", "legal.twitter.com", "login", "Login", "mail.", "mailto:",
"mediawiki", "messenger.com", "policies", "s.click", "showcaptcha?", "signup",
"smart-captcha/", "Special:", "support.", "t.umblr.com", "tel:", "tg://",
"whatsapp://", "zendesk", "_click_",
"/auth/", "/authorize?", "/captcha", "/chat", "/click", "/feed?", "/join?",
Expand Down Expand Up @@ -55,6 +55,7 @@ def url_in_blacklist(url):
return True

def url_fix(url):
url = url.strip('.')
if 'https://' not in url and 'http://' not in url:
url = f"https://{url}"
try:
Expand Down Expand Up @@ -140,8 +141,10 @@ def _thread(trend):
print(f"Recursive browsing {len(article_urls)} urls. Wait...", end='\n\n')
for i, url in enumerate(article_urls, start=1):
debug_print(f"{i}/{len(article_urls)} recursive browse")
min_depth = 15 if i <= 10 else 0
max_depth = 25 if i <= 10 else 5
if i <= 10:
min_depth, max_depth = 15, 25
else:
min_depth, max_depth = 0, 5
recursive_browse(url, depth=randint(min_depth, max_depth))

def fake_traffic(country='US', language='en-US', category='h', threads=THREADS, min_wait=MIN_WAIT, max_wait=MAX_WAIT, debug=DEBUG):
Expand Down

0 comments on commit 24219be

Please sign in to comment.