Skip to content

Latest commit

 

History

History
41 lines (34 loc) · 1.02 KB

README.md

File metadata and controls

41 lines (34 loc) · 1.02 KB

tor-wrapper-python

A python wrapper for tor to browse sites anonymously.

Development

Prerequisites:-
  1. Linux based OS
  2. Tor must be installed on the system.
    $ echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" > /etc/apt/sources.list
    $ apt install tor
Sample steps
  1. Install package using pip
 pip install git+ssh://git@github.com/vivekkumar2696/tor-wrapper-python.git
  1. Sample python code
from bizarre.tor import Tor
sudo_pwd = None # Optional. If not specified, there would be a prompt later to ask for password

tor = Tor()
tor.restart_tor(sudo_pwd)
br = tor.create_browser()
url='https://api.covid19india.org/states_daily.json'

response = br.open(url)
print(response.read())

create_browser() returns a mechanize._mechanize.Browser object

Update Identity
from bizarre.tor import Tor
sudo_pwd = None # Optional. If not specified, there would be a prompt later to ask for password

tor = Tor()
tor.restart_tor(sudo_pwd)