when I try to follow the tutorial ( https://stem.torproject.org/tutorials/to_russia_with_love.html ) on how to start Tor. I continue to get stuck at 45% and sometimes at 50%. I am using Windows 8, python 3.4 and the ideal of LiClipse.
[1mStarting Tor: [0m [34mApr 26 12: 47: 21.000 [notification] Bootable 0%: Startup [0m [34mApr 26 12: 47: 21.000 [notification] 45% downloaded: Request relay descriptors [0m [34mApr 26 13: 04 : 00.000 [notification] 50% downloaded: Relay descriptor loading [0m
The script looks like this: the change I made here is to use the requestslibrary instead urllibto rquest the data from the source, but I don’t get to this part of the code here anyway, It’s basically a copy of the code on the manual page using SocksiPy.
TorConnector.py:
from io import StringIO
import socket
import requests
import socks
import stem.process
from stem.util import term
SOCKS_PORT = 7000
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, '127.0.0.1', SOCKS_PORT)
socket.socket = socks.socksocket
def getaddrinfo(*args):
return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
socket.getaddrinfo = getaddrinfo
def query(url):
"""
Uses requests to fetch a site using SocksiPy for Tor over the SOCKS_PORT.
"""
try:
result = requests.get(url)
return result
except:
return "Unable to reach %s" % url
def print_bootstrap_lines(line):
if "Bootstrapped " in line:
print(term.format(line, term.Color.BLUE))
print(term.format("Starting Tor:\n", term.Attr.BOLD))
tor_process = stem.process.launch_tor_with_config(
config = {
'SocksPort': str(SOCKS_PORT),
'ExitNodes': '{ru}',
},
init_msg_handler = print_bootstrap_lines,
)
print(term.format("\nChecking our endpoint:\n", term.Attr.BOLD))
print(term.format(query("https://www.atagar.com/echo.php"), term.Color.BLUE))
tor_process.kill()
I also tried moving the TorConnector.py script file to a folder C:\Python34\Lib\site-packagesand running it from the command line using python TorConnector.py, but the same thing happens, I still stick to 45%.
Also, if I terminate the Tor.exe process when it is stuck at 45%, it tells me the following:
Traceback ( ): "C:\Users\gatsu\My \ LiClipse\TorCommunicator\TorConnector.py", 53, init_msg_handler = print_bootstrap_lines, "C:\Python34\lib\site-packages\stem\process.py", 246, launch_tor_with_config return start_tor (tor_cmd, args, torrc_path, complete_percent, init_msg_handler, timeout, take_ownership) "C:\Python34\lib\site-packages\stem\process.py", 136, launch_tor OSError ( " :% s" % last_problem) OSError: : GEOIP C:\Users\Gatsu\AppData\Roaming\\geoip6. ( ) , , , .
, , .
: C:\Users\gatsu\AppData\Roaming\tor\geoip6