From aff86e836d3b4e38f5be5c0ca5d5d9ac855cc231 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Wed, 6 Apr 2022 03:25:25 +0300 Subject: [PATCH] Feature: Wait mode for live streams --- peertube-cli.sh | 21 ++++++++++++++++++++- transmission-daemon/settings.json | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/peertube-cli.sh b/peertube-cli.sh index 31f8f02..31a6ae8 100755 --- a/peertube-cli.sh +++ b/peertube-cli.sh @@ -138,11 +138,30 @@ peertube_menu_stream() #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) + menu_video_choice=$(echo "Play\nWait mode\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 ;; + + "Wait mode") + playlist_stream=$(echo $get_video | jj streamingPlaylists.0.playlistUrl) + echo 'Wait mode enabled...' + echo 'Stream will be played when published state' + while [ -z $playlist_stream ]; do + get_video=$(peertube_api_get_video $1) + playlist_stream=$(echo $get_video | jj streamingPlaylists.0.playlistUrl) + wait=15 + while [ $wait -gt 0 ]; do + date + sleep 1 + wait=$(expr $wait - 1) + done + done + clear + echo 'Stream PUBLISHED!' + $default_player_command $playlist_stream + ;; esac done } diff --git a/transmission-daemon/settings.json b/transmission-daemon/settings.json index c1cca56..39e15e6 100644 --- a/transmission-daemon/settings.json +++ b/transmission-daemon/settings.json @@ -26,7 +26,7 @@ "peer-id-ttl-hours": 6, "peer-limit-global": 200, "peer-limit-per-torrent": 50, - "peer-port": 59577, + "peer-port": 57468, "peer-port-random-high": 65535, "peer-port-random-low": 49152, "peer-port-random-on-start": true,