From de915144b2f299721212ffea58af649b0035c32d Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Mon, 21 Nov 2022 01:49:19 +0300 Subject: [PATCH] Fix overhead get listen_url tracks... --- src/fw_api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/fw_api.py b/src/fw_api.py index 3f0092c..ed3d160 100644 --- a/src/fw_api.py +++ b/src/fw_api.py @@ -1,5 +1,6 @@ from src.mpv_control import set_http_header import requests, json, time +import urllib.parse import os from loguru import logger @@ -67,10 +68,10 @@ def get_audio_file(track_uuid, listen_url=False, download=False, transcoding=Fal "to": to } if listen_url: - r = s.head(f'https://{instance}{track_uuid}', params=params) + url = f'https://{instance}{track_uuid}?' else: - r = s.head(f'https://{instance}/api/v1/listen/{track_uuid}', params=params) - return r.url + url = f'https://{instance}/api/v1/listen/{track_uuid}?' + return url + urllib.parse.urlencode(params) @logger.catch