mirror of
https://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-23 18:39:19 +02:00
Compare commits
2 Commits
61265cceb8
...
0e6b7cccbf
Author | SHA1 | Date | |
---|---|---|---|
localhost_frssoft | 0e6b7cccbf | ||
localhost_frssoft | 89a8133de7 |
|
@ -72,7 +72,6 @@ def filter_tracks(tracks):
|
||||||
return filtred_tracks
|
return filtred_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,
|
||||||
|
@ -117,6 +116,8 @@ with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor:
|
||||||
except Exception as E:
|
except Exception as E:
|
||||||
print(E)
|
print(E)
|
||||||
for track in tracks_stor:
|
for track in tracks_stor:
|
||||||
artist, album, title, play_url = track['artist']['name'], track['album']['title'], track['title'], track['listen_url']
|
artist, album, title, play_url, track_duration, fid = track['artist']['name'], track['album']['title'], track['title'], track['listen_url'], track.get('duration'), track['fid']
|
||||||
playlist_files.append(f'#EXTINF:-1,{artist} - {album} - {title}\n{play_url}')
|
if not track_duration:
|
||||||
|
track_duration = -1
|
||||||
|
playlist_files.append(f'#EXTINF:{track_duration},{artist} - {album} - {title} url="{fid}"\n{play_url}')
|
||||||
create_playlist_file(playlist_files)
|
create_playlist_file(playlist_files)
|
||||||
|
|
Loading…
Reference in New Issue