diff --git a/sijapi.15s.py b/sijapi.15s.py index 7856e8f..a33ad01 100755 --- a/sijapi.15s.py +++ b/sijapi.15s.py @@ -40,6 +40,8 @@ for old_script in glob.glob(os.path.join(temp_dir, 'swiftbar_vpn_*.sh')): with open(config_yaml, 'r') as stream: config = yaml.safe_load(stream) servers = config['POOL'] + api_url = config['URL'] + api_key = config['KEYS'][0] def run_ssh_command(server, command): ssh = paramiko.SSHClient() @@ -99,7 +101,7 @@ def check_postgres(ip, port, dbname, user, password): def get_sij_id(): try: - response = requests.get("https://api.sij.ai/id?api_key=sk-NhrtQwCHNdK5sRZC", timeout=4) + response = requests.get(f"{api_url}/id?api_key={api_key}", timeout=4) response.raise_for_status() return response.text.strip().strip('"') except requests.exceptions.RequestException as e: @@ -107,12 +109,13 @@ def get_sij_id(): except Exception as e: return "Unexpected Error" + def flag_emoji(country_code): if country_code: offset = 127397 flag = ''.join([chr(ord(char) + offset) for char in country_code.upper()]) return flag - return flag_emoji('us') # American flag for no VPN + return flag_emoji('us') def gather_remote_info(server): vitals_output = run_ssh_command(server, f"bash -l -c '{server['vitals']}'")