python 2.7 - tor tutorial "speaking to russia" stuck at 45 - 50% -


when try follow tutorial (https://stem.torproject.org/tutorials/to_russia_with_love.html) how start tor keep getting stuck @ 45% , sometimes @ 50%. using windows 8, python 3.4 , liclipse ide.

[1mstarting tor: [0m [34mapr 26 12:47:21.000 [notice] bootstrapped 0%: starting[0m [34mapr 26 12:47:21.000 [notice] bootstrapped 45%: asking relay descriptors[0m [34mapr 26 13:04:00.000 [notice] bootstrapped 50%: loading relay descriptors[0m

the script looks this, change have made myself here use requests library instead of urllib rquest data source i'm not getting part of code here anyway. basicly copy of code @ tutorial page using socksipy.

torconnector.py:

from io import stringio import socket import requests  import socks  # socksipy module import stem.process  stem.util import term  socks_port = 7000  # set socks proxy , wrap urllib module  socks.setdefaultproxy(socks.proxy_type_socks5, '127.0.0.1', socks_port) socket.socket = socks.socksocket  # perform dns resolution through socket  def getaddrinfo(*args):   return [(socket.af_inet, socket.sock_stream, 6, '', (args[0], args[1]))]  socket.getaddrinfo = getaddrinfo  def query(url):   """   uses requests fetch site using socksipy tor on socks_port.   """    try:     result = requests.get(url)     return result   except:     return "unable reach %s" % url    # start instance of tor configured exit through russia. prints # tor's bootstrap information starts. note not # work if have tor instance running.  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()  # stops tor 

i have tried moving torconnector.py script file in c:\python34\lib\site-packages folder , run command prompt python torconnector.py same thing happens, still stuck on 45%.

also, if end tor.exe process when stuck @ 45% tells me this:

traceback (most recent call last): file "c:\users\gatsu\my documents\liclipse workspace\torcommunicator\torconnector.py", line 53, in init_msg_handler = print_bootstrap_lines, file "c:\python34\lib\site-packages\stem\process.py", line 246, in launch_tor_with_config return launch_tor(tor_cmd, args, torrc_path, completion_percent, init_msg_handler, timeout, take_ownership) file "c:\python34\lib\site-packages\stem\process.py", line 136, in launch_tor raise oserror('process terminated: %s' % last_problem) oserror: process terminated: failed open geoip file c:\users\gatsu\appdata\roaming\tor\geoip6. we've been configured use (or avoid) nodes in countries, , need geoip information figure out ones are.

i hope helps figure out why making me stuck.

i not have file: c:\users\gatsu\appdata\roaming\tor\geoip6

i found geoip , geoip6 files in tor browser folder (d:\program\tor browser\browser\torbrowser\data\tor) , copied them c:\users\gatsu\appdata\roaming\tor made me reach 100%.

[1mstarting tor: [0m [34mmay 01 23:28:53.000 [notice] bootstrapped 0%: starting[0m [34mmay 01 23:28:53.000 [notice] bootstrapped 80%: connecting tor network[0m [34mmay 01 23:28:54.000 [notice] bootstrapped 85%: finishing handshake first hop[0m [34mmay 01 23:28:54.000 [notice] bootstrapped 90%: establishing tor circuit[0m [34mmay 01 23:28:55.000 [notice] bootstrapped 100%: done[0m [1m checking our endpoint: [0m [34munable reach https://www.atagar.com/echo.php[0m


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -