revamped media scanner using custom built rust program, saving and getting progress capabilties, and more

This commit is contained in:
Brandon4466
2025-05-29 13:01:33 -07:00
commit cc290d5720
5 changed files with 674 additions and 0 deletions

37
client.py Normal file
View File

@@ -0,0 +1,37 @@
import requests
import webbrowser
API_BASE_URL = "http://localhost:8000"
def list_movies():
url = f"{API_BASE_URL}/movies"
try:
response = requests.get(url)
response.raise_for_status()
except Exception as e:
print(f"Error fetching movies: {e}")
return []
return response.json()
def main():
movies = list_movies()
if not movies:
print("No movies found.")
return
print("Available Movies:")
for movie in movies:
print(f"{movie['id']}: {movie.get('title', 'Unknown Title')}")
try:
movie_id = int(input("Enter movie ID to stream: "))
except ValueError:
print("Invalid input. Please enter a numeric movie ID.")
return
stream_url = f"{API_BASE_URL}/stream/{movie_id}"
print(f"Opening stream for movie ID {movie_id}...")
webbrowser.open(stream_url)
if __name__ == "__main__":
main()