mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-22 05:39:48 +00:00
raise for status in search
This commit is contained in:
parent
e3d523758d
commit
92a52dd2b8
@ -76,9 +76,12 @@ def filter_tracks(tracks):
|
||||
|
||||
|
||||
def search_tracks_on_instance(instance, tag='', query='', recursion=args.recursion):
|
||||
tracks = requests.get(f'https://{instance}/api/v1/tracks', params={'tag': tag, 'q': query,
|
||||
r = requests.get(f'https://{instance}/api/v1/tracks', params={'tag': tag, 'q': query,
|
||||
'local': True, 'playable': True,
|
||||
'ordering': 'random'}, timeout=10).json()
|
||||
'ordering': 'random'}, timeout=10)
|
||||
r.raise_for_status()
|
||||
tracks = r.json()
|
||||
|
||||
count = tracks['count']
|
||||
print(f'found {count} tracks on {instance}')
|
||||
if recursion == 1:
|
||||
|
Loading…
Reference in New Issue
Block a user