mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-25 21:23:33 +02:00
raise for status in search
This commit is contained in:
parent
e3d523758d
commit
92a52dd2b8
1 changed files with 5 additions and 2 deletions
|
@ -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 a new issue