Questions tagged [stem]

Stem is a Python controller library for Tor.

Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/).

For tutorials and API documentation see stem’s homepage.

Quick Start

To install you can either use…

pip install stem

… or install from the source tarball. Stem supports both the python 2.x and 3.x series. To use its python3 counterpart you simply need to install using that version of python.

python3 setup.py install

After that, give some tutorials a try! For questions or to discuss project ideas we’re available on irc and the tor-dev@ email list.

104 questions
0
votes
0 answers

How to identify from the descriptor whether a tor relay can be used a guard node or exit node?

I want to create a custom tor circuit. I can get the list of relay nodes using get_network_statuses() of stem library, but I am not sure how whether a specific node can be used as guard node, middle node or exit node. Is there any way to identify…
0
votes
0 answers

python3 does not change the tor IP

I try to change tor ip in python3 but it doesn't always work the same can you recommend me an effective method with python3? import time import socket import socks import requests from urllib.request import urlopen from stem import Signal from…
SaxC
  • 1
  • 1
0
votes
0 answers

Amplitude Spectrum of a function

My question is related to plotting amplitude spectrum. Problem 1: (I have solved it) I have to represent the following function as a discrete set of N=100 numbers separated by time increment of 1/N: e(t) = 3sin2.1t + 2sin1.9t I did it using stem…
user9470630
0
votes
1 answer

leaf and stem diagram incompatible with the layout function

I am trying to join 4 graphs with the layout function. However, I only get 3 represented: all except the stem and leaf diagram. In brief, this is what it looks like in r: layout(matrix(c(1,2,3,4), 2, 2, byrow…
LUCIA
  • 1
0
votes
0 answers

How to change IP while using Selenium with a Tor instance

I was trying to use Selenium with a Tor instance but I got caught in the Cloudflare page. So I wanted to change the IP address until it doesn't require Cloudflare check. I used the function below to renew the Tor instance but it didn't work. I…
mkde
  • 17
  • 1
  • 6
0
votes
0 answers

toString and uiString error: app is not giving a recommendations

I am making an app that is used to give the user a recommended element after they input what they are looking for, within the element. Everything is working, besides the recommendations at the end. The box stays empty and these two errors appear.…
0
votes
0 answers

Onion Server with Stem and CherryPy in Python

I want to create an Onion-Website with CherryPy in Python (using Stem to access the Tor network). My problem is the deployment of the site. For that I adopted the example from this article:…
Ulrich
  • 249
  • 4
  • 10
0
votes
1 answer

Cannot connect to my tcp tor hidden service in Python

I have a fully functional tor hidden service with his v3 url, created with stem and the controller class. The server is redirecting the traffic into a local tcp server running on port 5000 created with socket. But now I want to connect to this…
Gianla
  • 63
  • 8
0
votes
0 answers

How to get all the IP addresses of a client's tor circuit

Suppose I am sending a request to a .onion server (http://xxxxxx.onion/hello). Is there any way to find out the IP address of the 3 relies (guard/middle/exit node) of the client's circuit? I can check it using Tor Browser but I need to do it in…
0
votes
2 answers

Pylint marking code as an error that works

I've been using python to interact with Tor and Stem. And on line controller.signal(Signal.NEWNYM) in the code it's always marking Signal with the error Instance of 'Enum' has no 'NEWNYM' memberpylint(no-member) I have no idea why its doing this.…
0
votes
1 answer

Python tor stem Events not working as expected

I have been trying to add some functionality to NavigaTor (written in python 2), which uses stem library to build TOR circuits. Basically, if a circuit fails, i am trying to build a new one with a new path (Navigator does not do that by default, and…
Khizar Amin
  • 198
  • 1
  • 2
  • 12
0
votes
1 answer

Requests Session with Stem Not Closed Correctly, Tor No Longer Restarting

I built a program that runs a requests session in a separate thread, using stem sub-modules to update the control port. On an initial install and with the manual addition of the following parameters to the torrc file, things worked fine: ControlPort…
Joshua Harwood
  • 337
  • 1
  • 2
  • 15
0
votes
1 answer

How do I get the *current* Tor exit node IP address over the control port?

How do I get the external IP address of the current Tor exit node (the one which is in use) without using external services/websites (through curl or otherwise) but only through the Tor control port functionality (using bash or python3). NOTE: I…
0
votes
2 answers

Is there a point to using a with statement for creating a stem.control.Controller object?

I have some python that talks to a tor daemon, here it tells the daemon to shut down. from stem import Signal from stem.control import Controller def shutDownTor(): with Controller.from_port(port=portNum) as controller: …
spacecat
  • 138
  • 1
  • 11
0
votes
0 answers

loop in tweet text and if word not in stop word correct spelling, lemmatize, and stem

enter image description here the code below should loop through a tweet dataset- text column and if a word not in stop words list, it should correct spelling, lemmatize, then stem the word. It is not working properly can you help me fix it? please…
Ghadah
  • 11
  • 4