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
5 changes: 1 addition & 4 deletions StreamingCommunity/Lib/TMBD/tmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

if not api_key and show_trending:
show_trending = False
print("TMDB_API_KEY non trovata nel file .env")
#raise ValueError("TMDB_API_KEY non trovata nel file .env")


def get_select_title(table_show_manager, generic_obj):
Expand Down Expand Up @@ -307,6 +305,5 @@ def get_episodes(self, tv_show_id: int, season_number: int):
return data[choice]



# Output
tmdb = TheMovieDB(api_key)
tmdb = TheMovieDB(api_key)
2 changes: 1 addition & 1 deletion StreamingCommunity/Upload/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'StreamingCommunity'
__version__ = '3.4.4'
__version__ = '3.4.4.5'
__author__ = 'Arrowar'
__description__ = 'A command-line program to download film'
__copyright__ = 'Copyright 2025'
20 changes: 19 additions & 1 deletion StreamingCommunity/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,23 @@ def force_exit():
print("Uscita forzata con os._exit(0)")
os._exit(0)

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

env_path = os.path.join(os.getcwd(), '.env')
if not os.path.isfile(env_path):
console.print("\n[red]Please create a .env file in the current directory with the necessary configurations.")

for key in required_keys:
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

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

def check_dns():
"""Check DNS configuration and exit if required."""
Expand Down Expand Up @@ -472,6 +489,7 @@ def main(script_id=0):
get_bot_instance().send_message(f"Avviato script {script_id}", None)

Logger()
check_env_file()
execute_hooks('pre_run')
initialize()

Expand Down Expand Up @@ -512,4 +530,4 @@ def main(script_id=0):
if script_id != "unknown":
TelegramSession.deleteScriptId(script_id)
finally:
execute_hooks('post_run')
execute_hooks('post_run')