Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ python test_run.py
# Linux/MacOS
python3 test_run.py
```
---

## TMDB API Key required
To enable search features, you need to obtain a TMDB API key:
1. Sign up at [The Movie Database (TMDB)](https://developer.themoviedb.org/docs/getting-started)
2. Navigate to your account settings and find the API section
3. Generate a new API key
4. Add the API key to your .env file (inside the StreamingCommunity directory) under the `TMDB_API_KEY` variable or insert it when required during execution


---

Expand Down
20 changes: 15 additions & 5 deletions StreamingCommunity/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ def force_exit():
print("Uscita forzata con os._exit(0)")
os._exit(0)


def check_env_file():
required_keys = ['TMDB_API_KEY']

Expand All @@ -286,16 +287,25 @@ def check_env_file():
console.print("\n[red]Please create a .env file in the current directory with the necessary configurations.")

for key in required_keys:
console.print(f"\n[yellow]To get your {key}:[/yellow]")
console.print(f"[cyan]1. Go to: https://www.themoviedb.org/settings/api/request")
console.print(f"[cyan]2. Register or log in to your account")
console.print(f"[cyan]3. Create an API request and copy your API key\n[/cyan]")

while True:
value = console.input(f"[cyan]Please enter the value for [bold]{key}[/bold]: [/cyan]").strip()

with open(env_path, 'a') as f:
f.write(f"{key}={value}\n")
console.print(f"[green]{key} added to .env file.[/green]")
break

if value:
with open(env_path, 'a') as f:
f.write(f"{key}={value}\n")
console.print(f"[green]{key} added to .env file.[/green]")
break
else:
console.print(f"[red]Error: {key} cannot be empty. Please try again.[/red]")

console.print("\n[green].env file created successfully. Please restart the application.[/green]")


def check_dns():
"""Check DNS configuration and exit if required."""
if BYPASS_DNS:
Expand Down