mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-23 22:09:20 +02:00
Compare commits
No commits in common. "200deac9a693c0986bb7f700234f0922adb590e0" and "309e36db4358ae18bf3624ef523f03e47153919d" have entirely different histories.
200deac9a6
...
309e36db43
|
@ -34,7 +34,7 @@ def create_playlist_file(track_list):
|
||||||
def filter_tracks(tracks):
|
def filter_tracks(tracks):
|
||||||
def remove_unreach_tracks(track):
|
def remove_unreach_tracks(track):
|
||||||
try:
|
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()
|
r.raise_for_status()
|
||||||
return 1
|
return 1
|
||||||
except:
|
except:
|
||||||
|
@ -75,8 +75,7 @@ def filter_tracks(tracks):
|
||||||
def search_tracks_on_instance(instance, tag='', query='', recursion=args.recursion):
|
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,
|
r = requests.get(f'https://{instance}/api/v1/tracks', params={'tag': tag, 'q': query,
|
||||||
'local': True, 'playable': True,
|
'local': True, 'playable': True,
|
||||||
'ordering': 'random', 'scope': 'all'},
|
'ordering': 'random'}, timeout=10)
|
||||||
timeout=10, headers={'Content-Encoding': 'gzip'})
|
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
tracks = r.json()
|
tracks = r.json()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue