Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Some website will ban source ip that has abnormal traffic, so we need change source ip.

DMLTZY/python-tor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

python + tor

Some website will ban source ip that has abnormal traffic, so we need change source ip.

My environments

tips: brew install tor, pip install pysocks, pip install stem

Modify config file

add below to config file(/usr/local/etc/tor/torrc)

Socks5Proxy 127.0.0.1:1080 # maybe you don't need this in your country.
ControlPort 9051 #default
SocksPort 9050 #default
# use tor --hash-password "123456" to generate the hashcode
HashedControlPassword 16: <your hashcode>

notice: change password whatever you like and paste the hashcode after the last colon.

Run

$ brew services start tor
$ python tor.py

that's it, use it, but don't abuse it.

References & Thanks

  1. http://www.learn4master.com/programming-language/python/install-and-use-tor-on-ubuntu-for-python-requests
  2. https://deshmukhsuraj.wordpress.com/2015/03/08/anonymous-web-scraping-using-python-and-tor/
  3. https://gist.github.com/jefftriplett/9748036
  4. https://stackoverflow.com/questions/30286293/make-requests-using-python-over-tor
  5. https://stackoverflow.com/questions/28252649/stem-cant-get-new-ip-with-python-via-tor
  6. https://www.atgfw.org/2015/01/linux-tor.html

About

Some website will ban source ip that has abnormal traffic, so we need change source ip.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages