add beginning prototype
This commit is contained in:
36
app.py
Normal file
36
app.py
Normal file
@@ -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)
|
||||||
9
requirements.txt
Normal file
9
requirements.txt
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user