mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-29 12:51:29 +00:00
Compare commits
No commits in common. "200deac9a693c0986bb7f700234f0922adb590e0" and "395800f2800f20713622daf73ba783f6a527c5cf" have entirely different histories.
200deac9a6
...
395800f280
|
@ -34,7 +34,7 @@ def create_playlist_file(track_list):
|
|||
def filter_tracks(tracks):
|
||||
def remove_unreach_tracks(track):
|
||||
try:
|
||||
r = requests.head(track['listen_url'], timeout=2, headers={'Content-Encoding': 'gzip'})
|
||||
r = requests.head(track['listen_url'], timeout=2)
|
||||
r.raise_for_status()
|
||||
return 1
|
||||
except:
|
||||
|
@ -74,9 +74,8 @@ def filter_tracks(tracks):
|
|||
|
||||
def search_tracks_on_instance(instance, tag='', query='', recursion=args.recursion):
|
||||
r = requests.get(f'https://{instance}/api/v1/tracks', params={'tag': tag, 'q': query,
|
||||
'local': True, 'playable': True,
|
||||
'ordering': 'random', 'scope': 'all'},
|
||||
timeout=10, headers={'Content-Encoding': 'gzip'})
|
||||
'local': True, 'playable': True,
|
||||
'ordering': 'random'}, timeout=10)
|
||||
r.raise_for_status()
|
||||
tracks = r.json()
|
||||
|
||||
|
@ -113,7 +112,7 @@ with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor:
|
|||
filtred_tracks = filter_tracks(tracks['results'])
|
||||
after_filter = before_filter - len(filtred_tracks)
|
||||
print(f'{after_filter} tracks filtred on {instance}')
|
||||
tracks_stor += filtred_tracks
|
||||
tracks_stor = filtred_tracks
|
||||
except Exception as E:
|
||||
print(E)
|
||||
for track in tracks_stor:
|
||||
|
|
Loading…
Reference in a new issue