Frage

I found this code on github: https://github.com/Abrand88/Reddit-Tor-proxy-voting-bot/blob/master/reddit_proxy_voting_bot.py

I know that its a bot and potentially malicious but I thinks its cool nonetheless. From an educational perspective how do I get it working?: When I run the program it outputs "socket:" twice and then gives the error "KeyError: '127.0.0.1'"

Any thoughts?

War es hilfreich?

Lösung

it's using a dictionary and can't find the key for your local host.

this is probably causing the error breaking:

ip_hash={}; # the dictionary is made

and

ip_hash[ip] = 1; # the dictionary is incorrectly accessed

this part alone isn't a good idea:

if ip in ip_hash:
    print " repeat " + ip;
else:
    ip_hash[ip] = 1;
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top