Feat: windows support

This commit is contained in:
coolnsx
2024-05-25 21:43:50 +05:30
parent 106710dd14
commit e47e15c564

12
dra-cla
View File

@@ -3,9 +3,9 @@
#shellcheck disable=SC2154 #shellcheck disable=SC2154
# most important variables. # most important variables.
VERSION="3.0.0" VERSION="3.0.1"
CHANNEL="main" CHANNEL="main"
base_url="https://pladrac.net" base_url="https://streamcool.pro"
logdir="${XDG_CACHE_HOME:-$HOME/.cache}" logdir="${XDG_CACHE_HOME:-$HOME/.cache}"
logfile="$logdir/dra-hsts" logfile="$logdir/dra-hsts"
quality=best quality=best
@@ -190,9 +190,14 @@ get_video_url() {
#create history file #create history file
[ -d "$logdir" ] || mkdir "$logdir" [ -d "$logdir" ] || mkdir "$logdir"
[ -f "$logfile" ] || : >"$logfile" [ -f "$logfile" ] || : >"$logfile"
download_dir="."
# OS detection for player selection and default download location. # OS detection for player selection and default download location.
case "$(uname -o)" in case "$(uname -a)" in
*MINGW* | *WSL2*)
player_function="mpv.exe"
alt_player="vlc.exe"
;;
*ndroid*) *ndroid*)
player_function="android_mpv" player_function="android_mpv"
download_dir="/sdcard" download_dir="/sdcard"
@@ -200,7 +205,6 @@ case "$(uname -o)" in
;; ;;
*) *)
player_function="mpv" player_function="mpv"
download_dir="."
alt_player="vlc" alt_player="vlc"
command -v "doas" >/dev/null && sudo="doas " || sudo="sudo " command -v "doas" >/dev/null && sudo="doas " || sudo="sudo "
;; ;;