| | import time |
| | import os |
| | from fastrtc import get_cloudflare_turn_credentials |
| |
|
| | def main(): |
| | print("\n" + "="*40) |
| | print(" π DEBUG: Fetching Cloudflare TURN Credentials") |
| | print("="*40 + "\n") |
| |
|
| | try: |
| | |
| | |
| | creds = get_cloudflare_turn_credentials() |
| | |
| | print("β
Success! Here is the RTC Configuration:") |
| | print("-" * 20) |
| | print(creds) |
| | print("-" * 20) |
| | |
| | except Exception as e: |
| | print("β Error fetching credentials.") |
| | print(f"Details: {e}") |
| | print("\nPossible fix: Ensure 'HF_TOKEN' is set in your Space secrets.") |
| |
|
| | print("\n" + "="*40) |
| | print(" π€ Script sleeping... Check the 'Logs' tab to see the output above.") |
| | print("="*40 + "\n") |
| |
|
| | |
| | while True: |
| | time.sleep(60) |
| |
|
| | if __name__ == "__main__": |
| | main() |