mirror of
http://gitea.phreedom.club/localhost_frssoft/peertube-cli
synced 2024-11-16 13:33:17 +00:00
added live streams
This commit is contained in:
parent
52d598b7e6
commit
409ab15f8c
|
@ -41,6 +41,11 @@ peertube_api_get_local_videos()
|
|||
fi
|
||||
}
|
||||
|
||||
peertube_api_get_live_streams()
|
||||
{
|
||||
curl -s --compressed "$instance_point/videos?count=100&start=$1&isLive=true&sort=-publishedAt" | jj -p | tee preload >> /dev/null
|
||||
}
|
||||
|
||||
peertube_api_get_video()
|
||||
{
|
||||
curl -s --compressed "$instance_point/videos/$1"
|
||||
|
@ -66,7 +71,11 @@ peertube_menu_videos()
|
|||
fi ;;
|
||||
*)
|
||||
video_uuid=$(jj -i preload data.#[name="$menu_videos_choice"].uuid)
|
||||
peertube_menu_video $video_uuid ;
|
||||
if [ "$1" = 'lives' ]; then
|
||||
peertube_menu_stream $video_uuid
|
||||
else
|
||||
peertube_menu_video $video_uuid
|
||||
fi ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
@ -108,6 +117,30 @@ peertube_menu_video()
|
|||
done
|
||||
}
|
||||
|
||||
peertube_menu_stream()
|
||||
{
|
||||
clear
|
||||
sub2_menu=1
|
||||
get_video=$(peertube_api_get_video $1)
|
||||
while [ $sub2_menu -eq 1 ]; do
|
||||
name=$(echo $get_video | jj name)
|
||||
desc=$(echo $get_video | jj description)
|
||||
channel=$(echo $get_video | jj channel.name)
|
||||
playlist_stream=$(echo $get_video | jj streamingPlaylists.0.playlistUrl)
|
||||
state=$(echo $get_video | jj state.label)
|
||||
echo "Status: $state"
|
||||
#torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].torrentUrl)
|
||||
echo "Channel: $channel"
|
||||
echo "Description video:\n$desc"
|
||||
menu_video_choice=$(echo "Play\nBack\nMain menu" | fzy)
|
||||
case $menu_video_choice in
|
||||
"Main menu") sub2_menu=0 && sub_menu=0 ;;
|
||||
"Back") sub2_menu=0 ;;
|
||||
"Play") $default_player_command $playlist_stream ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
menu_settings()
|
||||
{
|
||||
sub_menu=1
|
||||
|
@ -143,13 +176,14 @@ version=$(peertube_api_version_server)
|
|||
torrent_init
|
||||
videosmenu='All Videos'
|
||||
videosmenulocal='Local Videos'
|
||||
streamsmenu='Live streams'
|
||||
changepod='Switch instance'
|
||||
settings='Settings'
|
||||
checkapilimits='Check API limits (debug)'
|
||||
Exit='Exit'
|
||||
|
||||
while true; do
|
||||
choice=$(echo "$videosmenu\n$videosmenulocal\n$changepod\n$settings\n$checkapilimits\n$Exit" | fzy)
|
||||
choice=$(echo "$videosmenu\n$videosmenulocal\n$streamsmenu\n$changepod\n$settings\n$checkapilimits\n$Exit" | fzy)
|
||||
|
||||
case "$choice" in
|
||||
|
||||
|
@ -160,6 +194,10 @@ while true; do
|
|||
"$videosmenulocal")
|
||||
peertube_api_get_local_videos 0
|
||||
peertube_menu_videos 'local' ;;
|
||||
|
||||
"$streamsmenu")
|
||||
peertube_api_get_live_streams 0
|
||||
peertube_menu_videos 'lives' ;;
|
||||
|
||||
"$changepod")
|
||||
empty=0
|
||||
|
|
Loading…
Reference in a new issue