From 221aa66a585872c63a1aea6a36181cea7d24565c Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 2 Jan 2023 04:19:09 +0300 Subject: [PATCH] Add worst support external transcoding http server path --- src/fw_api.py | 5 ++++- src/settings.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fw_api.py b/src/fw_api.py index 38b9d1d..32daf16 100644 --- a/src/fw_api.py +++ b/src/fw_api.py @@ -72,7 +72,8 @@ def get_instance_settings(): @logger.catch -def get_audio_file(track_uuid, listen_url=False, download=False, +def get_audio_file(track_uuid, listen_url=False, download=False, + external_transcoding=get_config('external_transcoder_http_proxy_path'), transcoding=get_config('enable_server_transcoding'), to='ogg'): params = { "download": download, @@ -84,6 +85,8 @@ def get_audio_file(track_uuid, listen_url=False, download=False, url = f'https://{current_instance.instance}{track_uuid}?' else: url = f'https://{current_instance.instance}/api/v1/listen/{track_uuid}?' + if external_transcoding != "": + url = external_transcoding + url return url + urllib.parse.urlencode(params, doseq=True) diff --git a/src/settings.py b/src/settings.py index df79ad6..8fc1ff8 100644 --- a/src/settings.py +++ b/src/settings.py @@ -41,6 +41,7 @@ default_conf = { "shitnoise.monster" ], 'enable_server_transcoding': False, + 'external_transcoder_http_proxy_path': "", 'track_activity_history': False, 'prefetch_playlist': True, 'mpv_volume': 100,