Feat: Syncplay Support

This commit is contained in:
coolnsx
2024-06-03 22:01:36 +05:30
parent d5561c4474
commit f60aac356c
2 changed files with 10 additions and 2 deletions

View File

@@ -80,5 +80,6 @@ For VLC: pass ``` dra-cla -v ```
- curl - curl
- openssl - openssl
- mpv - Video Player - mpv - Video Player
- syncplay - for watching with friends
- aria2 - Download manager - aria2 - Download manager
- ffmpeg - m3u8 Downloader - ffmpeg - m3u8 Downloader

11
dra-cla
View File

@@ -3,7 +3,7 @@
#shellcheck disable=SC2154 #shellcheck disable=SC2154
# most important variables. # most important variables.
VERSION="3.0.1" VERSION="3.0.2"
CHANNEL="main" CHANNEL="main"
base_url="https://streamcool.pro" base_url="https://streamcool.pro"
logdir="${XDG_CACHE_HOME:-$HOME/.cache}" logdir="${XDG_CACHE_HOME:-$HOME/.cache}"
@@ -147,6 +147,7 @@ open_episode() {
vlc*) [ -z "$nohup" ] && $player_function --play-and-exit --meta-title="${title} Episode ${episode}" "$video_link" >/dev/null 2>&1 || ( $nohup $player_function --play-and-exit --meta-title="${title} Episode ${episode}" "$video_link" >/dev/null 2>&1 & );; vlc*) [ -z "$nohup" ] && $player_function --play-and-exit --meta-title="${title} Episode ${episode}" "$video_link" >/dev/null 2>&1 || ( $nohup $player_function --play-and-exit --meta-title="${title} Episode ${episode}" "$video_link" >/dev/null 2>&1 & );;
android_vlc) am start --user 0 -a android.intent.action.VIEW -d "$video_link" -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e "title" "${title} Episode ${episode}" >/dev/null 2>&1 ;; android_vlc) am start --user 0 -a android.intent.action.VIEW -d "$video_link" -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e "title" "${title} Episode ${episode}" >/dev/null 2>&1 ;;
download) "$player_function" "$video_link" "${title} Episode ${episode}" "$relative_link" "$total_eps";; download) "$player_function" "$video_link" "${title} Episode ${episode}" "$relative_link" "$total_eps";;
*yncpla*) nohup "$player_function" "$video_link" -- --force-media-title="${title} Episode ${episode}" >/dev/null 2>&1 & ;;
esac esac
dpage_link="" dpage_link=""
@@ -197,6 +198,8 @@ case "$(uname -a)" in
*MINGW* | *WSL2*) *MINGW* | *WSL2*)
player_function="mpv.exe" player_function="mpv.exe"
alt_player="vlc.exe" alt_player="vlc.exe"
export PATH="$PATH":"/c/Program Files (x86)/Syncplay/"
syncplay="syncplay.exe"
;; ;;
*ndroid*) *ndroid*)
player_function="android_mpv" player_function="android_mpv"
@@ -206,11 +209,12 @@ case "$(uname -a)" in
*) *)
player_function="mpv" player_function="mpv"
alt_player="vlc" alt_player="vlc"
syncplay="syncplay"
command -v "doas" >/dev/null && sudo="doas " || sudo="sudo " command -v "doas" >/dev/null && sudo="doas " || sudo="sudo "
;; ;;
esac esac
while getopts 'vq:dp:chDUVa:' OPT; do while getopts 'vq:dp:chDUVa:s' OPT; do
case $OPT in case $OPT in
d) d)
player_function="download" player_function="download"
@@ -226,6 +230,9 @@ while getopts 'vq:dp:chDUVa:' OPT; do
player_function="download" player_function="download"
download_dir=$OPTARG download_dir=$OPTARG
;; ;;
s)
player_function=$syncplay
;;
q) q)
quality=$OPTARG quality=$OPTARG
;; ;;