简体   繁体   English

Python:请求Tor,启用旋转IP - 缺少torrc文件

[英]Python: Requests over Tor , Enabling rotating IP - missing torrc file

I'm trying to set up requests over Tor, while rotating over IPs. 我正在尝试通过Tor设置请求,同时在IP上进行旋转。

I've found this answer explaining everything quite clear. 我发现这个答案非常清楚地解释了一切。 I've set it up and am able to request via Tor. 我已经设置好了,我可以通过Tor请求。 That is, via one single IP. 也就是说,通过一个IP。

To allow for rotation, I need to uncomment some lines in a file named torrc , as described in the answer. 为了允许旋转,我需要取消注释名为torrc的文件中的某些行,如答案中所述。 However, this file does not exist on my computer. 但是,我的计算机上不存在此文件。

I've checked tor.stackoverflow and found this answer , however its there neither. 我检查了tor.stackoverflow并找到了这个答案 ,但它没有。 I posed a question on tor.stackoverflow, but the only comment I got so far hasn't helped. 我对tor.stackoverflow提出了一个问题 ,但到目前为止我唯一的评论没有帮助。 It also seems tor.stackoverflow isn't that active. 看来tor.stackoverflow也没那么活跃。

I hope someone here had the same issue and is able to help me. 我希望这里有人有同样的问题,能够帮助我。 I'm working on Mac OS X Sierra 10.12.3. 我正在使用Mac OS X Sierra 10.12.3。

I am the author of the answer in your question. 我是你问题答案的作者。

The torrc sample should be located at /opt/local/etc/tor/torrc.sample as per the documentation and you can copy that to some other place and start tor using the copied torrc. 根据文档,torrc示例应位于/opt/local/etc/tor/torrc.sample ,您可以将其复制到其他位置并使用复制的torrc启动。

tor -f </path/to/torrc> [args]

In case you do not find the sample torrc, you can get one from the official svn source . 如果你没有找到样本torrc,你可以从官方的svn源获得一个。

If you want to find out what your currently running tor instance is using as it's torrc , I checked the running processes on my system ( ps -ef | grep tor for Ubuntu) and found the following 如果你想知道你当前运行的tor实例正在使用什么,因为它是torrc ,我检查了我的系统上的运行进程( ps -ef | grep tor for Ubuntu)并找到以下内容

debian-+  1373     1  0 09:30 ?        00:00:16 /usr/bin/tor --defaults-torrc /usr/share/tor/tor-service-defaults-torrc -f /etc/tor/torrc --RunAsDaemon 0

Maybe you can do something similar on your system and if lucky, get the -f argument and thus the default torrc location. 也许你可以在你的系统上做类似的事情,如果幸运的话,得到-f参数,从而得到默认的torrc位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM