From f219662ee76100588db2f94bde4c2ad5d9c3fa76 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 23 Jul 2024 22:36:05 +0300 Subject: [PATCH] basic playlist generation --- funkwlplay | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 funkwlplay diff --git a/funkwlplay b/funkwlplay new file mode 100755 index 0000000..cef468e --- /dev/null +++ b/funkwlplay @@ -0,0 +1,17 @@ +#!/bin/bash +fw_instance="${wf_instance:=open.audio}" + +get(){ + curl $1 +} + +case $1 in + "tag") search="tag=$2" ;; + "search") read input ; search="q=$input" ;; +esac +echo '#EXTM3U' > playlist.m3u8 +for i in $(cat instances); do + get "https://$i/api/v1/tracks?playable=true&hidden=false&include_channels=false&order=random&$search" | jq -r ".results.[] | \"#EXTINF:-1, \\(.title)\nhttps://$i\\(.listen_url)\"" >> playlist.m3u8 & +done + +