Add worst support external transcoding http server path

This commit is contained in:
localhost_frssoft 2023-01-02 04:19:09 +03:00
parent 24b0b24ad9
commit 221aa66a58
2 changed files with 5 additions and 1 deletions

View file

@ -73,6 +73,7 @@ def get_instance_settings():
@logger.catch @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'): transcoding=get_config('enable_server_transcoding'), to='ogg'):
params = { params = {
"download": download, "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}?' url = f'https://{current_instance.instance}{track_uuid}?'
else: else:
url = f'https://{current_instance.instance}/api/v1/listen/{track_uuid}?' 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) return url + urllib.parse.urlencode(params, doseq=True)

View file

@ -41,6 +41,7 @@ default_conf = {
"shitnoise.monster" "shitnoise.monster"
], ],
'enable_server_transcoding': False, 'enable_server_transcoding': False,
'external_transcoder_http_proxy_path': "",
'track_activity_history': False, 'track_activity_history': False,
'prefetch_playlist': True, 'prefetch_playlist': True,
'mpv_volume': 100, 'mpv_volume': 100,