#!/usr/bin/env python3 from pyotp import TOTP import requests from traceback import print_exc while True: try: code = TOTP("aVeryLongSecretCode").now() requests.get("http://localhost:4646/ffxivlauncher/" + code, timeout=10) break except requests.exceptions.ConnectionError: print_exc()