From 7e30e7d4808e79109ec25300b970e63e127ea7e8 Mon Sep 17 00:00:00 2001 From: jagadeesha Date: Sun, 27 Aug 2017 13:46:44 +0530 Subject: [PATCH 1/4] modified to work with python3 --- README.md | 2 + __init__.py | 0 __pycache__/pytor.cpython-35.pyc | Bin 0 -> 3753 bytes pytor-test.py | 15 +-- pytor.py | 220 +++++++++++++++---------------- 5 files changed, 118 insertions(+), 119 deletions(-) create mode 100644 __init__.py create mode 100644 __pycache__/pytor.cpython-35.pyc diff --git a/README.md b/README.md index 67682a9..ca31bf8 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ Have Pytor periodically assign a new identity. (Note that this currently works w tor.identityTime(1200) # Request a new identity every 1,200 seconds (20 minutes) ``` +deprecated: + To create a new instance of a mechanize browser: ```python br = tor.mechanizeBrowser() diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/__pycache__/pytor.cpython-35.pyc b/__pycache__/pytor.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af10e30e152fc709dca717e0779ceca58353efde GIT binary patch literal 3753 zcma)9OLN@D5$*x7FL3!VMTwMT%W&i*-bf;o%EKv_lE|?ohc0t1J{(y{xe#zMnv<$>%*m&GJyOup0B^|9xTt! z`v3guFOR>NCHgm=xm@V?aO=kq2~h|sC~+tg)ORR!NO0Sw%%#3Zp;xv&$|}^aQdlk9 z70PN9*65?8N=c1gV3isjVSb&G3T?OQlmGY+AMbp+<@>=W>3-LYCCgx};^9!LU@up} zSndY8gN}5tAB;3h)0M#v9u1@!=js5HgN-~%_fnYzyNAJ@;Ny6IKSl4SD&0>9aTdHk zGF?o#6Z~4mN$?vPo9^vk7y4?K^?UpMIL%f&dH;5BkGpNJ?{D4T{A_*e{>J_G&bHsU z6Fe9VIws8rY{Wb9APHhLpUPH%Ed)cAKRe`6+eY?-cZTUONC(=)Sr%yYw0!?1z@(Na z{15VhQF)e0g;sSt-G`0P>Pc**N&B+h;gQEz4az;-`o9no&H(a|4!b0D*(<;wz6dLn zz!!kJ!k`0l#u>6M6D!Qw<|RtzDOq3_hf9=T@S@c(Q-ViJR=+|Cnpdp8ObPy0tiD3YRZ6Z|9m;h| zUZ>;@yX-Z#aJzM*s0q@nZ9 zf&S@xYinPN_d>60%rLC5)I}{$5+$`RykV})PHVnsc1rq1+);QIL*Fh?_B01lCed_I zQ6I)yBg~S*)kYQdhMd#mf4<~!2s1{fuuyrXE6uyS5hnZ_x0ViZr+z`y@PD+;bEs6 ztNufk_prEL+lvq6K#uiVKh>RRWYSEpS>BX#b$AH#qjZp(DEdCu($^qJG){iE#4YGI z#3jgiF`2WISC6N>yn)djm*?Q(jWEe9!QO|$ZXMUAn@N2aJvVQ$rm#i-MjorCp+0X2s^7*W)fd@_>S=)&EXMlIm| z$AC_s6rPdKOwlY+1_MT!X?bdyN4g`Gsn=N(%A#6|tK3tY&i@%2n$aiW1CoYlipgvV z$aKUxC>Rb4#TJxPC|JXOkD)jcf)T*Rkz*V>a7cY@n`Hz7lMg)GJ=$ zGua;Gsx8MG7&U#BFD47+t4<$xc*}gbxEr|bEAK!tc&qg;%K9Id={dOWSeL``HdTs8 zuw`@Wb8C^)E}Zdh%PqWoCZyFkTGm_k66Em%bbp%%1@9vwk)ML zVS~0w9~do*$x>WQ z8L-11F}TMbTUY^1W%UDOXjZ9b3m%Fj!w1;WJB_Rh&!)p0WPIw)*x?szB+^K$(wW0rTYoM=q6SU*e15_?#80x( zXIOyY0O&*qIB0CzCZhAWS%QC54imHj2b2>Iz}Zbc@|ElUbo*gVOH}tasGldJjP+&|JsHJW`J_C$*prN<5OXH1M^B~F_=GquQi`oB(QC2B^b2ddDj#d9 z%0rM1cRsAxidUw9A8_*)iyyK0F$+eyOcg(8?X=QajjNU7_+(~kP6bUw^(%f()ww=D zUz=|>J^U(7zd6&a+1af|QH!D^??h49&mk{33Au>s#^ XSy8`R;`mE;q9sGsSr7}jo9_Prs$B}> literal 0 HcmV?d00001 diff --git a/pytor-test.py b/pytor-test.py index fdad41c..af087c9 100644 --- a/pytor-test.py +++ b/pytor-test.py @@ -1,11 +1,10 @@ from pytor import pytor -import urllib2 +import urllib.request, urllib.error, urllib.parse -ip = urllib2.urlopen('http://bradheath.org/ip').read() -tor = pytor(controller=True, controlPort = 9051, port = 9060, password='YOURPASSWORD') - -print "Without Tor, my IP address is : " + ip -print "With Tor, my IP address is : " + tor.ip() -tor.newIdentity() -print "Now my IP address is : " + tor.ip() +ip = urllib.request.urlopen('http://bradheath.org/ip').read() +tor = pytor(host='10.130.4.162',need_control=True, control_port = 9051, socks_port = 9050, password='tor@lab') +print("Without Tor, my IP address is : " + str(ip)) +print("With Tor, my IP address is : " + tor.ip()) +tor.getNewIdentity() +print("Now my IP address is : " + tor.ip()) diff --git a/pytor.py b/pytor.py index d1f64c3..e39cb7f 100644 --- a/pytor.py +++ b/pytor.py @@ -1,118 +1,116 @@ -# PYTOR -# Lightweight wrapper for web scraping on the Tor network -# Brad Heath, brad.heath@gmail.com, @bradheath -# -# REQUIREMENTS -# - Functioning (and active) TOR proxy -# - SocksiPy (socks.py installed to lib/site-packages) -# - Stem (pip install stem) -# - Mechanize -# -# - -import stem +""" +PYTOR + + Lightweight wrapper for web scraping using the Tor network + + Modified by - Jaggi, @kanihal + Author - Brad Heath, brad.heath@gmail.com, @bradheath + +REQUIREMENTS + - Functioning (and active) TOR proxy + - Stem (pip install stem) + +""" + from stem.control import Controller from stem import Signal -import mechanize -import datetime + +from _datetime import datetime import requests + class pytor: + control_port = 9051 + socks_port = 9050 + host = 'localhost' + password = '' + _version = 0.1 + _last_result = None + _last_request = None + _id_time = None + _last_id_time = None + _ip = None + _connected = False + browser = None + need_control = False + + _proxies = {} + + def __init__(self, host='localhost', socks_port=9050, need_control=False, control_port=9051, password=''): + self.control_port = control_port + self.host = host + self.socks_port = socks_port + self.need_control = need_control + self.password=password + self._proxies['http'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) + self._proxies['https'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) + if self.need_control: + self.controller = Controller.from_port(address=self.host, port=control_port) + self.controller.authenticate(self.password) + self._connected = True + self._last_id_time = datetime.now() + return + + def request(self, url, timeout=30): + self._checkIdentityTime() + r = requests.get(url, timeout=timeout, proxies=self._proxies) + self._last_request = url + self._last_result = r.text + return r + + def get(self, url, t=30): + self._checkIdentityTime() + + r = self.request(url, timeout=t) + + if r.status_code == 200: + self._last_result = r.text + self._last_request = url + return self._last_result + else: + return False + + def ip(self): + self._ip = self.get('http://bradheath.org/ip') + return self._ip + + def timeForNew(self): + self._checkIdentityTime() + return + + def saveLastResult(self, file): + with open(file, 'wb') as local_file: + local_file.write(self._last_result) + return + + def downloadFile(self, url, file): + self._checkIdentityTime() + r = requests.get(url, stream=True, proxies=self._proxies) + with open(file, 'wb') as local_file: + for chunk in r.iter_content(chunk_size=1024): + if chunk: + local_file.write(chunk) + self._last_request = url + return True + + def getNewIdentity(self): + print("## NEW IDENTITY ## ") + if not self._connected: + self.controller = Controller.from_port(address=self.host, port=self.control_port) + self.controller.authenticate(self.password) + self._connected = True + self.controller.authenticate(self.password) + self.controller.signal(Signal.NEWNYM) + self._last_id_time = datetime.now() + return True - controlPort = 9051 - port = 9050 - host = 'localhost' - password = '' - _version = 0.1 - _last_result = None - _last_request = None - _id_time = None - _last_id_time = None - _ip = None - _connected = False - browser = None - controller = False - - _proxies = {} - - def __init__(self, host='localhost', port=9050, controller=False, controlPort = 9051, password=''): - self.controlPort = controlPort - self.port = port - self.controller = controller - self._proxies['http'] = 'socks5://localhost:' + str(self.port) - self._proxies['https'] = 'socks5://localhost:' + str(self.port) - if self.controller: - self.torControl = Controller.from_port(port=controlPort) - self.torControl.authenticate(self.password) - self._connected = True - self._last_id_time = datetime.datetime.now() - return - - def request(self, url, timeout = 30): - self._checkIdentityTime() - r = requests.get(url, timeout=timeout, proxies=self._proxies) - self._last_request = url - self._last_result = r.text - return r - - def get(self, url, t=30): - self._checkIdentityTime() - - r = self.request(url, timeout = t) - - if r.status_code == 200: - self._last_result = r.text - self._last_request = url - return self._last_result - else: - return False - - def ip(self): - self._ip = self.get('http://bradheath.org/ip') - return self._ip - - def timeForNew(self): - self._checkIdentityTime() - return - - def saveLastResult(file): - with open(file, 'wb') as local_file: - local_file.write(self._last_result) - return - - def downloadFile(self, url, file): - self._checkIdentityTime() - r = requests.get(url, stream = True, proxies = self._proxies) - with open(file, 'wb') as local_file: - for chunk in r.iter_content ( chunk_size = 1024) - if chunk: - local_file.write(chunk) - self._last_request = url - return True - - def newIdentity(self): - print "## NEW IDENTITY ## " - if not self._connected: - self.torControl = Controller.from_port(port=self.controlPort) - self.torControl.authenticate(self.password) - self._connected = True - self.torControl.authenticate(self.password) - self.torControl.signal(Signal.NEWNYM) - self._last_id_time = datetime.datetime.now() - return True - - def _checkIdentityTime(self): - if self._id_time != None and self._last_id_time != None: - if (datetime.datetime.now() - self._last_id_time).seconds >= self._id_time: - print 'Getting new identity' - self.newIdentity() - return - - def identityTime(self, time = 600): - self._id_time = time - return - - def mechanizeBrowser(self): - self.browser = mechanize.Browser() - return self.browser + def _checkIdentityTime(self): + if self._id_time != None and self._last_id_time != None: + if (datetime.now() - self._last_id_time).seconds >= self._id_time: + print('Getting new identity') + self.getNewIdentity() + return + def identityTime(self, time=600): + self._id_time = time + return From 490885095950c158adf5b370d8d0b10ca7bd7cd2 Mon Sep 17 00:00:00 2001 From: jagadeesha Date: Sun, 27 Aug 2017 13:53:06 +0530 Subject: [PATCH 2/4] updated readme --- README.md | 7 +++---- pytor.py | 5 +---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ca31bf8..9132611 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ Pytor allows you to channel simple http requests through a Tor proxy. It also al Requirements ============ -* A functioning (and running) instance of Tor. This could be the basic Tor Browser Bundle. For more configuration options, consider using the Tor Expert Bundle, available from https://www.torproject.org/download/download.html.en. -* Mechanize (install through pip) +* A functioning (and running) instance of Tor. This could be the basic Tor Browser Bundle. For more configuration options, consider using the Tor Expert Bundle, available from https://www.torproject.org/download/download.html.en. * Stem (install through pip or apt-get) Basic usage @@ -23,7 +22,7 @@ html = tor.get('http://bradheath.org') Or, if your Tor configuration requires a different host or port: ```python from pytor import pytor -tor = pytor(host='localhost', port=9055) +tor = pytor(host='localhost', socks_port=9055) html = tor.get('http://bradheath.org') ``` @@ -44,7 +43,7 @@ tor = pytor( port = 9050, controller = True, controlPort = 9051, password='Your- Request a new identity from Tor: (Note that the network won't always assign you one, and even when it does, you may end up with the same exit node and therefore the same IP address. Also note that you shouldn't change your identity too ofen to avoid stressing the network.) ```python -tor.newIdentity() +tor.getNewIdentity() ``` Have Pytor periodically assign a new identity. (Note that this currently works with get() and download_file() requests, but does not currently force a new identity when using a mechanize browser. More on that later.) diff --git a/pytor.py b/pytor.py index e39cb7f..d8df90a 100644 --- a/pytor.py +++ b/pytor.py @@ -3,9 +3,6 @@ Lightweight wrapper for web scraping using the Tor network - Modified by - Jaggi, @kanihal - Author - Brad Heath, brad.heath@gmail.com, @bradheath - REQUIREMENTS - Functioning (and active) TOR proxy - Stem (pip install stem) @@ -68,7 +65,7 @@ def get(self, url, t=30): self._last_request = url return self._last_result else: - return False + return None def ip(self): self._ip = self.get('http://bradheath.org/ip') From 59490806dfc113961a13c16e051e124ea46d3044 Mon Sep 17 00:00:00 2001 From: jagadeesha Date: Sun, 27 Aug 2017 15:42:04 +0530 Subject: [PATCH 3/4] Rewriting the entire thing to suite my purpose --- __pycache__/pytor.cpython-35.pyc | Bin 3753 -> 0 bytes pytor.py | 114 ++++++++-------------------- requirements.txt | 3 + test/ip.py | 12 +++ test/nip.py | 11 +++ pytor-test.py => test/pytor-test.py | 10 ++- 6 files changed, 64 insertions(+), 86 deletions(-) delete mode 100644 __pycache__/pytor.cpython-35.pyc create mode 100644 requirements.txt create mode 100644 test/ip.py create mode 100644 test/nip.py rename pytor-test.py => test/pytor-test.py (54%) diff --git a/__pycache__/pytor.cpython-35.pyc b/__pycache__/pytor.cpython-35.pyc deleted file mode 100644 index af10e30e152fc709dca717e0779ceca58353efde..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3753 zcma)9OLN@D5$*x7FL3!VMTwMT%W&i*-bf;o%EKv_lE|?ohc0t1J{(y{xe#zMnv<$>%*m&GJyOup0B^|9xTt! z`v3guFOR>NCHgm=xm@V?aO=kq2~h|sC~+tg)ORR!NO0Sw%%#3Zp;xv&$|}^aQdlk9 z70PN9*65?8N=c1gV3isjVSb&G3T?OQlmGY+AMbp+<@>=W>3-LYCCgx};^9!LU@up} zSndY8gN}5tAB;3h)0M#v9u1@!=js5HgN-~%_fnYzyNAJ@;Ny6IKSl4SD&0>9aTdHk zGF?o#6Z~4mN$?vPo9^vk7y4?K^?UpMIL%f&dH;5BkGpNJ?{D4T{A_*e{>J_G&bHsU z6Fe9VIws8rY{Wb9APHhLpUPH%Ed)cAKRe`6+eY?-cZTUONC(=)Sr%yYw0!?1z@(Na z{15VhQF)e0g;sSt-G`0P>Pc**N&B+h;gQEz4az;-`o9no&H(a|4!b0D*(<;wz6dLn zz!!kJ!k`0l#u>6M6D!Qw<|RtzDOq3_hf9=T@S@c(Q-ViJR=+|Cnpdp8ObPy0tiD3YRZ6Z|9m;h| zUZ>;@yX-Z#aJzM*s0q@nZ9 zf&S@xYinPN_d>60%rLC5)I}{$5+$`RykV})PHVnsc1rq1+);QIL*Fh?_B01lCed_I zQ6I)yBg~S*)kYQdhMd#mf4<~!2s1{fuuyrXE6uyS5hnZ_x0ViZr+z`y@PD+;bEs6 ztNufk_prEL+lvq6K#uiVKh>RRWYSEpS>BX#b$AH#qjZp(DEdCu($^qJG){iE#4YGI z#3jgiF`2WISC6N>yn)djm*?Q(jWEe9!QO|$ZXMUAn@N2aJvVQ$rm#i-MjorCp+0X2s^7*W)fd@_>S=)&EXMlIm| z$AC_s6rPdKOwlY+1_MT!X?bdyN4g`Gsn=N(%A#6|tK3tY&i@%2n$aiW1CoYlipgvV z$aKUxC>Rb4#TJxPC|JXOkD)jcf)T*Rkz*V>a7cY@n`Hz7lMg)GJ=$ zGua;Gsx8MG7&U#BFD47+t4<$xc*}gbxEr|bEAK!tc&qg;%K9Id={dOWSeL``HdTs8 zuw`@Wb8C^)E}Zdh%PqWoCZyFkTGm_k66Em%bbp%%1@9vwk)ML zVS~0w9~do*$x>WQ z8L-11F}TMbTUY^1W%UDOXjZ9b3m%Fj!w1;WJB_Rh&!)p0WPIw)*x?szB+^K$(wW0rTYoM=q6SU*e15_?#80x( zXIOyY0O&*qIB0CzCZhAWS%QC54imHj2b2>Iz}Zbc@|ElUbo*gVOH}tasGldJjP+&|JsHJW`J_C$*prN<5OXH1M^B~F_=GquQi`oB(QC2B^b2ddDj#d9 z%0rM1cRsAxidUw9A8_*)iyyK0F$+eyOcg(8?X=QajjNU7_+(~kP6bUw^(%f()ww=D zUz=|>J^U(7zd6&a+1af|QH!D^??h49&mk{33Au>s#^ XSy8`R;`mE;q9sGsSr7}jo9_Prs$B}> diff --git a/pytor.py b/pytor.py index d8df90a..0cdded0 100644 --- a/pytor.py +++ b/pytor.py @@ -1,113 +1,63 @@ """ -PYTOR +PyTor +python wrapper for anonymizing (web scraping?) requests using Tor. - Lightweight wrapper for web scraping using the Tor network - -REQUIREMENTS - - Functioning (and active) TOR proxy - - Stem (pip install stem) +Intially forked from https://github.com/bdheath/pytor +But I am rewriting the entire thing for my purpose """ from stem.control import Controller from stem import Signal - -from _datetime import datetime import requests +from datetime import datetime -class pytor: - control_port = 9051 - socks_port = 9050 - host = 'localhost' - password = '' - _version = 0.1 - _last_result = None - _last_request = None - _id_time = None - _last_id_time = None - _ip = None - _connected = False - browser = None - need_control = False - _proxies = {} +#TODO - add agent randomizer etc +#TODO - renew id interval (multi threading) +#TODO - pass along the kwargs +class PyTor: def __init__(self, host='localhost', socks_port=9050, need_control=False, control_port=9051, password=''): - self.control_port = control_port + + self.host = host self.socks_port = socks_port self.need_control = need_control + self.control_port = control_port self.password=password - self._proxies['http'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) - self._proxies['https'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) + self.proxies = {} + self.proxies['http'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) + self.proxies['https'] = 'socks5://' + str(self.host) + ':' + str(self.socks_port) + if self.need_control: self.controller = Controller.from_port(address=self.host, port=control_port) self.controller.authenticate(self.password) - self._connected = True - self._last_id_time = datetime.now() + else: + self.controller = None return - def request(self, url, timeout=30): - self._checkIdentityTime() - r = requests.get(url, timeout=timeout, proxies=self._proxies) - self._last_request = url - self._last_result = r.text - return r - def get(self, url, t=30): - self._checkIdentityTime() + def get(self, url, timeout=30): + response = requests.get(url, timeout=timeout, proxies=self.proxies) + return response - r = self.request(url, timeout=t) + def post(self): + #TODO + pass - if r.status_code == 200: - self._last_result = r.text - self._last_request = url - return self._last_result + def ip(self): + response = self.get('http://icanhazip.com/') # standard url + if response.status_code==200: + self._ip=response.text + return self._ip else: return None - def ip(self): - self._ip = self.get('http://bradheath.org/ip') - return self._ip - - def timeForNew(self): - self._checkIdentityTime() - return - - def saveLastResult(self, file): - with open(file, 'wb') as local_file: - local_file.write(self._last_result) - return - - def downloadFile(self, url, file): - self._checkIdentityTime() - r = requests.get(url, stream=True, proxies=self._proxies) - with open(file, 'wb') as local_file: - for chunk in r.iter_content(chunk_size=1024): - if chunk: - local_file.write(chunk) - self._last_request = url - return True - - def getNewIdentity(self): - print("## NEW IDENTITY ## ") - if not self._connected: + def get_new_identity(self): + if not self.controller: self.controller = Controller.from_port(address=self.host, port=self.control_port) self.controller.authenticate(self.password) - self._connected = True - self.controller.authenticate(self.password) self.controller.signal(Signal.NEWNYM) - self._last_id_time = datetime.now() - return True - - def _checkIdentityTime(self): - if self._id_time != None and self._last_id_time != None: - if (datetime.now() - self._last_id_time).seconds >= self._id_time: - print('Getting new identity') - self.getNewIdentity() - return - - def identityTime(self, time=600): - self._id_time = time - return + return self.ip() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9f5640f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +stem +requests +requests[socks] diff --git a/test/ip.py b/test/ip.py new file mode 100644 index 0000000..ba10ba3 --- /dev/null +++ b/test/ip.py @@ -0,0 +1,12 @@ +import requests + +tor_proxy = 'socks5://10.130.4.162:9050' #lab machine +socks_proxy = { 'http': tor_proxy, + 'https': tor_proxy + } + +current_ip = requests.get(url='http://icanhazip.com/',proxies=socks_proxy,verify=False) + +print(current_ip.text) + + diff --git a/test/nip.py b/test/nip.py new file mode 100644 index 0000000..3a3c30d --- /dev/null +++ b/test/nip.py @@ -0,0 +1,11 @@ +from stem import Signal +from stem.control import Controller + + +def get_new_ip(): + """Change IP using TOR""" + with Controller.from_port(address = '10.130.4.162', port=9051) as controller: + controller.authenticate(password='tor@lab') + controller.signal(Signal.NEWNYM) + +get_new_ip() diff --git a/pytor-test.py b/test/pytor-test.py similarity index 54% rename from pytor-test.py rename to test/pytor-test.py index af087c9..7fa0198 100644 --- a/pytor-test.py +++ b/test/pytor-test.py @@ -1,8 +1,10 @@ -from pytor import pytor -import urllib.request, urllib.error, urllib.parse +from pytor import PyTor +import requests +r = requests.get(url='http://icanhazip.com/') +if(r.status_code==200): + ip=r.text -ip = urllib.request.urlopen('http://bradheath.org/ip').read() -tor = pytor(host='10.130.4.162',need_control=True, control_port = 9051, socks_port = 9050, password='tor@lab') +tor = PyTor(host='10.130.4.162',need_control=True, control_port = 9051, socks_port = 9050, password='tor@lab') print("Without Tor, my IP address is : " + str(ip)) print("With Tor, my IP address is : " + tor.ip()) From adfedda95f3393afb9bac150b799537e1b1b3b8e Mon Sep 17 00:00:00 2001 From: jagadeesha Date: Mon, 28 Aug 2017 16:09:43 +0530 Subject: [PATCH 4/4] rename and stuff --- README.md | 10 ++++++++++ __pycache__/pytor.cpython-35.pyc | Bin 0 -> 1982 bytes pytor.py | 6 +++--- test/{nip.py => new-ip.py} | 2 +- test/privoxy.py | 15 +++++++++++++++ test/pytor-test.py | 19 +++++++++++++++---- 6 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 __pycache__/pytor.cpython-35.pyc rename test/{nip.py => new-ip.py} (82%) create mode 100644 test/privoxy.py diff --git a/README.md b/README.md index 9132611..556d556 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,15 @@ Pytor ===== +PyTor +python wrapper for anonymizing (web scraping?) requests using Tor. + +Intially forked from https://github.com/bdheath/pytor (not properly written) + +But I am **rewriting** the entire thing with some extensions (see #TODOs) + +### Need to update this readme + + Pytor is a Python wrapper for scraping over the Tor network. This is useful if you've been blocked (either locally or remotely) from the server you're attempting to scrape, or if it's otherwise important to not reveal your identity. diff --git a/__pycache__/pytor.cpython-35.pyc b/__pycache__/pytor.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69e787ef0e107f08813b1477fac1d325726c86f7 GIT binary patch literal 1982 zcma)7&5q+l5U#eJIPqkD_HRb8Vq_K$n3XaDi36hnR;&Q+fe2}k&>9KL6ZcGoedH7U zNjDxB`Xdbe6e1&vAq8a)6@q3C#SRIcyHvO|^CAXm*OsoZ?Z0B zKE1*zK3!tJPnk!@QE&Nc@ZIA3N(J@8OsX=xP-$ID6`ocqOv|cV%<^Sko`oM=$dgcy zv5MIjQK;mzxzt97bIr>*VHgBYN|UEWvEbe3G7C>tH47)k)cWw?;4C+j`N?ox%??ho ziA>Gp05K8y%ee`kgy{@tUZ~vgab_YziNlnH$_7qnwg~IFsw*vn;0mZvB%0uHRT@Vl2P8IY|HBK-==KG>VWnZpuOF6EV6OGsK#kAskF)C_lUmEe}rsk++AhG z?+(Ue4E+bh3qdc45-5&UFm{TJ67>1hZ~%2$xWB_Dbb~%J#b}jWf0cDOK@}P z2+a9kt{xrnCWqATWPF+e2^$s>fDm%IB!`3dZP-3d1FOI;NR$Ar&CM#ukw04Ybu~WM zpMVXo#bN9*HR6sXNaLqjrli)5S69kJ8;!?^HG$ocu&o)CQfA4xt#~t7DeYRXPPM+M zRMz;ls-EXkH?B5HIl!~&GZ95^$zluQ z7gG1|dc83mw!|IQi>8+(d6}Ce*~OB68-m=v_~-XfJaqbEU+h9Iw=5rq*ITak;XQVF z4;~MLnP6G)0Ez+fs5}@735HrOpca?Hd5QYFpqM*qeCBvHH)-*9f^*_$>S+N5T#L8(kOo{`T@>?U~~IqeJ|%2XiMWeJY_C7U2VUV%Ect^ zj=uU~^z>Wx0F(cy-wp_nl=33UGj15OIE3#CguZxJ+`(_TyXMNjTt`ul`=m@~GD(^s zNoG|xFIXQW$+LM{v@2>4N7}k5ZVa1^dY?6JyBoqXm7!(3&0!$!-`(~G-k_)0j(C2O zWYsuH;(<1DhRWN22@6W>vB}