From a859cdb2f5edfe0260b9df6ebea961ddcee69853 Mon Sep 17 00:00:00 2001 From: William Bell <62452284+Ugric@users.noreply.github.com> Date: Mon, 8 Dec 2025 16:58:45 +0000 Subject: [PATCH] add beginning prototype --- app.py | 36 ++++++++++++++++++++++++++++++++++++ requirements.txt | 9 +++++++++ 2 files changed, 45 insertions(+) create mode 100644 app.py create mode 100644 requirements.txt diff --git a/app.py b/app.py new file mode 100644 index 0000000..10d2953 --- /dev/null +++ b/app.py @@ -0,0 +1,36 @@ +from jellyfin_apiclient_python import JellyfinClient +import json +import uuid +import subprocess +from dotenv import load_dotenv +import os + +client = JellyfinClient() + +load_dotenv() + +client.config.app('FinPod', '0.0.1', 'FinPod prototype', 'FinPod_prototype_1') +client.config.data["auth.ssl"] = True +play_id = str(uuid.uuid4()) +container = "flac" +client.auth.connect_to_address(os.getenv("host")) +client.auth.login(os.getenv("URL"), os.getenv("username"), os.getenv("password")) + +credentials = client.auth.credentials.get_credentials() +server = credentials["Servers"][0] +server["username"] = 'username' +print(json.dumps(server)) + +ffmpeg = subprocess.Popen( + ["ffmpeg", "-i", "pipe:0", "-f", "wav", "pipe:1"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE +) + +aplay = subprocess.Popen( + ["aplay"], + stdin=ffmpeg.stdout +) +freebird = client.jellyfin.search_media_items( + term="Free Bird", media="Music")['Items'][0] +client.jellyfin.get_audio_stream(ffmpeg.stdin, freebird['Id'], play_id, container) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..6c2e964 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +certifi==2025.11.12 +charset-normalizer==3.4.4 +dotenv==0.9.9 +idna==3.11 +jellyfin-apiclient-python==1.11.0 +python-dotenv==1.2.1 +requests==2.32.5 +urllib3==2.6.1 +websocket-client==1.9.0