mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-12-25 21:23:33 +02:00
prototype on python3
This commit is contained in:
parent
1ce0a738cc
commit
f701359f8c
1 changed files with 17 additions and 0 deletions
17
funkwlplay.py
Normal file
17
funkwlplay.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import requests
|
||||
import concurrent.futures
|
||||
|
||||
tracks_stor = []
|
||||
with open('instances') as instances:
|
||||
instances = instances.read().split('\n')
|
||||
|
||||
|
||||
def search_tracks_on_instance(instance, tag='', query=''):
|
||||
tracks = requests.get(f'https://{instance}/api/v1/tracks', params={'tag': tag, 'q': query}).json()
|
||||
return tracks
|
||||
#filter_tracks(tracks)
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor() as executor: # optimally defined number of threads
|
||||
res = [executor.submit(search_tracks_on_instance, instance, '', '') for instance in instances]
|
||||
concurrent.futures.wait(res)
|
||||
|
Loading…
Reference in a new issue