mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-23 09:13:32 +02:00
Fix overhead get listen_url tracks...
This commit is contained in:
parent
d56630b71e
commit
de915144b2
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue