GithubHelp home page GithubHelp logo

tempbottle / pytor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adibalcan/pytor

0.0 2.0 0.0 226 KB

Python module for http requests by tor network

License: GNU General Public License v2.0

Python 100.00%

pytor's Introduction

PyTor

Python module for http requests by Tor network. PyTor change automatically IP address when a string marker is detected in response to a request.

Requirements

Tor,

Privoxy

Installation

ATENTION: First install pip and git

pip install git+git://github.com/adibalcan/PyTor.git@master

Usage

import pytor

# Use here, password from tor configuration
pytor.password='YOURPASSWORD' 

# Automatically change the IP address if one of those strings are met in http response
pytor.invalidStringList = ['Sorry, you\'re not allowed to access this page.', 'One more step']

# Change the IP address automatically after 100 requests
pytor.maxRequestsPerIP = 100 

# Change the IP address if response is shorter then 200 chars
pytor.minSourceLength = 200 

# Show IP address at every request 
pytor.showIp = True

# Show output messages 
pytor.silent = False

# Get source :)
print(pytor.getSource('http://thewebminer.com'))

Privoxy configuration

Privoxy's main configuration file is already prepared for Tor, if you are using a default Tor configuration and run it on the same system as Privoxy, you just have to edit the forwarding section and uncomment the next line from /etc/privoxy/config:

#        forward-socks5t             /     127.0.0.1:9050 .

Tor configuration

Generate a hash password

tor --hash-password YOURPASSWORD

Uncomment this line from /etc/tor/torrc

ControlPort 9051

Update hash generated above in /etc/tor/torrc

HashedControlPassword 16:3C78EB9AB441234760C108BCC7F8CF3138FA14378C116ECD3E9C942E51

pytor's People

Contributors

adibalcan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.