Fix long time loading

This commit is contained in:
localhost_frssoft 2022-04-05 20:36:11 +03:00
parent 79da2a4a0a
commit b05c5c0c20
1 changed files with 6 additions and 6 deletions

View File

@ -55,6 +55,8 @@ peertube_menu_video()
name=$(echo $get_video | jj name) name=$(echo $get_video | jj name)
desc=$(echo $get_video | jj description) desc=$(echo $get_video | jj description)
channel=$(echo $get_video | jj channel.name) channel=$(echo $get_video | jj channel.name)
video_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].fileUrl)
torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].torrentUrl)
echo "Channel: $channel" echo "Channel: $channel"
echo "Description video:\n$desc" echo "Description video:\n$desc"
menu_video_choice=$(echo "Play\nBack\nMain menu" | fzy) menu_video_choice=$(echo "Play\nBack\nMain menu" | fzy)
@ -62,22 +64,20 @@ peertube_menu_video()
"Main menu") sub2_menu=0 && sub_menu=0 ;; "Main menu") sub2_menu=0 && sub_menu=0 ;;
"Back") sub2_menu=0 ;; "Back") sub2_menu=0 ;;
"Play") "Play")
video_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].fileUrl)
torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].torrentUrl)
if [ -z "$video_url" ]; then if [ -z "$video_url" ]; then
echo "Resolution $pref_video_quality\p not avalaible" echo "Resolution $pref_video_quality"'p not avalaible'
echo 'Please choice:' echo 'Please choice:'
resolution=$(echo $get_video | jj -l streamingPlaylists.0.files.#.resolution.label | fzy) resolution=$(echo $get_video | jj -l streamingPlaylists.0.files.#.resolution.label | fzy)
video_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].fileUrl) video_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].fileUrl)
torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].torrentUrl) torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].torrentUrl)
fi fi
echo 'Loading may long time for big video'
if [ "$torrent_enabled" = 'true' ]; then if [ "$torrent_enabled" = 'true' ]; then
transmission-remote 9095 -a $torrent_url transmission-remote 9095 -a $torrent_url
$default_player_command $video_url curl -s --tcp-fastopen --output - $video_url | $default_player_command -
transmission-remote 9095 -t 1 -rad transmission-remote 9095 -t 1 -rad
else else
$default_player_command $video_url curl -s --tcp-fastopen --output - $video_url | $default_player_command -
fi ;; fi ;;
esac esac
done done