mirror of
http://gitea.phreedom.club/localhost_frssoft/peertube-cli
synced 2024-09-28 06:37:50 +00:00
Fix when HLS disabled on server
This commit is contained in:
parent
409ab15f8c
commit
51326f326a
|
@ -89,8 +89,14 @@ 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)
|
check_hls_empty=$(echo $get_video | jj streamingPlaylists.0)
|
||||||
torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.id=$pref_video_quality].torrentUrl)
|
if [ -z $check_hls_empty ]; then
|
||||||
|
hls=''
|
||||||
|
else
|
||||||
|
hls='streamingPlaylists.0.'
|
||||||
|
fi
|
||||||
|
video_url=$(echo $get_video | jj "$hls"files.#[resolution.id=$pref_video_quality].fileUrl)
|
||||||
|
torrent_url=$(echo $get_video | jj "$hls"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)
|
||||||
|
@ -101,9 +107,9 @@ peertube_menu_video()
|
||||||
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 "$hls"files.#.resolution.label | fzy)
|
||||||
video_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].fileUrl)
|
video_url=$(echo $get_video | jj "$hls"files.#[resolution.label=$resolution].fileUrl)
|
||||||
torrent_url=$(echo $get_video | jj streamingPlaylists.0.files.#[resolution.label=$resolution].torrentUrl)
|
torrent_url=$(echo $get_video | jj "$hls"files.#[resolution.label=$resolution].torrentUrl)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$torrent_enabled" = 'true' ]; then
|
if [ "$torrent_enabled" = 'true' ]; then
|
||||||
|
|
Loading…
Reference in a new issue