mirror of
http://gitea.phreedom.club/localhost_frssoft/funkwlmpv
synced 2024-11-22 07:21:28 +00:00
upload
This commit is contained in:
commit
4b1a142e81
14
README.md
Normal file
14
README.md
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# funkwhale-cli
|
||||||
|
Just for fun. Simple "player" API script for FunkWhale instances.
|
||||||
|
|
||||||
|
Futures:
|
||||||
|
* Download tracks url's in playlist per page
|
||||||
|
* All others futures maybe working 50/50
|
||||||
|
|
||||||
|
Depends:
|
||||||
|
* mpv (recommended)
|
||||||
|
* jj
|
||||||
|
* curl
|
||||||
|
* fzy
|
||||||
|
|
||||||
|
Also, thk Horhik for FunkWhale instance (set by default instance)
|
48
funkwhale-cli.sh
Executable file
48
funkwhale-cli.sh
Executable file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
instance='sound.redeyes.club'
|
||||||
|
default_player=mpv
|
||||||
|
ordering='title'
|
||||||
|
|
||||||
|
funkwhale_api_check_api_limits()
|
||||||
|
{
|
||||||
|
curl "https://$instance/api/v1/rate-limit/" | jj -p
|
||||||
|
}
|
||||||
|
|
||||||
|
funkwhale_api_get_tracks()
|
||||||
|
{
|
||||||
|
curl "https://$instance/api/v1/tracks?ordering=$ordering&playable=true&page=$1" | jj -l 'results.#.uploads.0.listen_url' | sed 's/"//g'
|
||||||
|
}
|
||||||
|
|
||||||
|
funkwhale_api_get_albums()
|
||||||
|
{
|
||||||
|
curl https://$instance/api/v1/albums/ | jj -p results
|
||||||
|
}
|
||||||
|
|
||||||
|
load_tracks_to_playlist()
|
||||||
|
{
|
||||||
|
for i in $(funkwhale_api_get_tracks $1); do
|
||||||
|
echo "https://$instance$i" >> playlist
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadtrackspls='Download tracks in playlist'
|
||||||
|
startplayer='Start player'
|
||||||
|
checkapilimits='Check API limits (debug)'
|
||||||
|
Exit='Exit'
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
choice=$(echo "$downloadtrackspls\n$startplayer\n$checkapilimits\n$Exit" | fzy)
|
||||||
|
|
||||||
|
if [ "$choice" = "$downloadtrackspls" ]; then
|
||||||
|
echo 'Enter page number: '
|
||||||
|
read page
|
||||||
|
load_tracks_to_playlist $page
|
||||||
|
elif [ "$choice" = "$startplayer" ]; then
|
||||||
|
$default_player --no-vid --no-ytdl --playlist=playlist
|
||||||
|
elif [ "$choice" = "$checkapilimits" ]; then
|
||||||
|
funkwhale_api_check_api_limits | more
|
||||||
|
elif [ "$choice" = "$Exit" ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in a new issue