mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-22 01:01:27 +00:00
Fix overhead get listen_url tracks...
This commit is contained in:
parent
d56630b71e
commit
de915144b2
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue