diff --git a/funkwlplay.py b/funkwlplay.py index b00bff3..5332974 100755 --- a/funkwlplay.py +++ b/funkwlplay.py @@ -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: