Fix overhead get listen_url tracks...

This commit is contained in:
localhost_frssoft 2022-11-21 01:49:19 +03:00
parent d56630b71e
commit de915144b2

View File

@ -1,5 +1,6 @@
from src.mpv_control import set_http_header from src.mpv_control import set_http_header
import requests, json, time import requests, json, time
import urllib.parse
import os import os
from loguru import logger from loguru import logger
@ -67,10 +68,10 @@ def get_audio_file(track_uuid, listen_url=False, download=False, transcoding=Fal
"to": to "to": to
} }
if listen_url: if listen_url:
r = s.head(f'https://{instance}{track_uuid}', params=params) url = f'https://{instance}{track_uuid}?'
else: else:
r = s.head(f'https://{instance}/api/v1/listen/{track_uuid}', params=params) url = f'https://{instance}/api/v1/listen/{track_uuid}?'
return r.url return url + urllib.parse.urlencode(params)
@logger.catch @logger.catch