Skip to content

Commit 96321bd

Browse files
Add TMDB API key instructions to README.md (#442)
* Add TMDB API key instructions to README.md
1 parent 73f47d0 commit 96321bd

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ python test_run.py
7575
# Linux/MacOS
7676
python3 test_run.py
7777
```
78+
---
79+
80+
## TMDB API Key required
81+
To enable search features, you need to obtain a TMDB API key:
82+
1. Sign up at [The Movie Database (TMDB)](https://developer.themoviedb.org/docs/getting-started)
83+
2. Navigate to your account settings and find the API section
84+
3. Generate a new API key
85+
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
86+
7887

7988
---
8089

StreamingCommunity/run.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def force_exit():
278278
print("Uscita forzata con os._exit(0)")
279279
os._exit(0)
280280

281+
281282
def check_env_file():
282283
required_keys = ['TMDB_API_KEY']
283284

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

288289
for key in required_keys:
290+
console.print(f"\n[yellow]To get your {key}:[/yellow]")
291+
console.print(f"[cyan]1. Go to: https://www.themoviedb.org/settings/api/request")
292+
console.print(f"[cyan]2. Register or log in to your account")
293+
console.print(f"[cyan]3. Create an API request and copy your API key\n[/cyan]")
294+
289295
while True:
290296
value = console.input(f"[cyan]Please enter the value for [bold]{key}[/bold]: [/cyan]").strip()
291-
292-
with open(env_path, 'a') as f:
293-
f.write(f"{key}={value}\n")
294-
console.print(f"[green]{key} added to .env file.[/green]")
295-
break
297+
298+
if value:
299+
with open(env_path, 'a') as f:
300+
f.write(f"{key}={value}\n")
301+
console.print(f"[green]{key} added to .env file.[/green]")
302+
break
303+
else:
304+
console.print(f"[red]Error: {key} cannot be empty. Please try again.[/red]")
296305

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

308+
299309
def check_dns():
300310
"""Check DNS configuration and exit if required."""
301311
if BYPASS_DNS:

0 commit comments

Comments
 (0)