lets
This commit is contained in:
commit
9581bcc174
10 changed files with 191 additions and 0 deletions
13
fedilives/owncast.sh
Executable file
13
fedilives/owncast.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
: "${1?How to use: $0 OWNCAST_LINK }"
|
||||
|
||||
url="$1"
|
||||
link=$(echo "$url" | sed 's#https://##' | sed 's#/##' )
|
||||
echo
|
||||
|
||||
xdg-open https://"$link"/embed/chat/readwrite &
|
||||
|
||||
mpv https://"$link" &
|
||||
|
||||
exit 0
|
59
fedilives/peertube.sh
Normal file
59
fedilives/peertube.sh
Normal file
|
@ -0,0 +1,59 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
: "${1?How to use: $0 PT_VIDEO_LINK}"
|
||||
|
||||
link="$1"
|
||||
|
||||
### Get HTML
|
||||
|
||||
wget "$link" -O /tmp/videohtml
|
||||
|
||||
### Variables
|
||||
|
||||
videolink=$( grep "meta property" /tmp/videohtml | grep "og:video:url" \
|
||||
| sed 's/.*href="//' | sed 's#" />##')
|
||||
chatver=$( grep 'peertube-plugin-livechat' /tmp/videohtml | grep 'version'\
|
||||
| sed 's#.*npmName..:..peertube-plugin-livechat.....name..:..livechat.....version..:..##' \
|
||||
| sed 's#.....description.....PeerTube plugin livechat: offers a way.*##' )
|
||||
instance=$(echo "$videolink" | sed 's#https://##' | sed 's#/videos/watch/.*##')
|
||||
videoid=$(echo $videolink | sed 's#.*videos/watch/##')
|
||||
|
||||
### Delete html
|
||||
|
||||
rm /tmp/videohtml
|
||||
|
||||
### Functions
|
||||
|
||||
function live()
|
||||
{
|
||||
xdg-open https://"$instance"/plugins/livechat/"$chatver"/router/webchat/room/"$videoid" &
|
||||
mpv https://"$instance"/static/streaming-playlists/hls/"$videoid"/0.m3u8 &
|
||||
exit 0
|
||||
}
|
||||
|
||||
function nolive()
|
||||
{
|
||||
mpv --ytdl-format=best "$videolink"
|
||||
exit 0
|
||||
}
|
||||
|
||||
### Choose
|
||||
|
||||
echo
|
||||
echo "Is it live? (Y/n)"
|
||||
read -r is_live
|
||||
echo
|
||||
|
||||
case "$is_live" in
|
||||
"" | "y")
|
||||
live
|
||||
;;
|
||||
"n")
|
||||
nolive
|
||||
;;
|
||||
* )
|
||||
echo "Ты, блять, дурак что ли? Белым по чёрному написано y или n"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue