issue #36 - env variables: added the dotenv module and fixed requirements.txt

Since the .env file will be igonred you need to create a .env file in the root of the project. here are my variables TOR_HOST=socks5h://127.0.0.1 TOR_PORT=9050 WEBSOCKET_PORT=3030
This commit is contained in:
SovereigntyIsNotFreedom 2025-03-22 19:24:03 +00:00
parent 35e04b6eda
commit d952950a6c
5 changed files with 29 additions and 7 deletions

View file

@ -1,14 +1,20 @@
from websockets.sync.client import connect
from dotenv import load_dotenv
import json
import random
import os
load_dotenv()
websocket_port = os.environ.get("WEBSOCKET_PORT")
print(websocket_port)
def is_simplex_link_valid(simplex_link: str) -> bool:
"""
Connects to the group using the `simplex_link`. If the response contains error False will be returned else True.
"""
with connect("ws://localhost:3030") as websocket:
with connect(f"ws://localhost:{websocket_port}") as websocket:
query = f"/c incognito {simplex_link}"
command = {
'corrId': f"id{random.randint(0,999999)}",