mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2026-06-17 07:22:12 +05:30
should get thru ci now
This commit is contained in:
+28
-19
@@ -11,7 +11,7 @@ menu_linux() {
|
||||
}
|
||||
|
||||
search_droid() {
|
||||
printf "%s" "$1" && read -r query
|
||||
printf "\n\033[1;33m%s\033[0m" "$1" && read -r query
|
||||
}
|
||||
|
||||
search_linux() {
|
||||
@@ -28,7 +28,7 @@ torrent_droid() {
|
||||
}
|
||||
|
||||
info_droid() {
|
||||
printf "\n\r\033[1;36m%s" "$1"
|
||||
printf "\n\r\033[1;36m%s\033[0m" "$1"
|
||||
}
|
||||
|
||||
info_linux() {
|
||||
@@ -36,7 +36,7 @@ info_linux() {
|
||||
}
|
||||
|
||||
error_droid() {
|
||||
printf "\33[2K\r\033[1;31m%s" "$1"
|
||||
printf "\33[2K\r\033[1;31m%s\033[0m" "$1"
|
||||
}
|
||||
|
||||
error_linux() {
|
||||
@@ -44,24 +44,33 @@ error_linux() {
|
||||
}
|
||||
|
||||
player_droid() {
|
||||
dir="/sdcard/mpv"
|
||||
file="$dir/mpv.config.mp4"
|
||||
if [ -w "${dir%*/mpv}" ]; then
|
||||
[ -d "${dir}" ] || mkdir "${dir}"
|
||||
printf "%s" "$3" | sed 's| --|\n|g; s|^--||g' > "$file"
|
||||
sleep 10 && : > "$file" &
|
||||
else
|
||||
printf "\n\033[1;31mCannot write\033[0m → $file\n"
|
||||
printf "\033[1;36mRun:\033[0m termux-setup-storage\n\n"
|
||||
printf "\033[1;36mThen:\033[0m\n"
|
||||
printf "> allow storage permission\n"
|
||||
printf "> add → include='$file'\n"
|
||||
printf " to MPV → Settings > Advanced > mpv.conf\n"
|
||||
fi
|
||||
am start --user 0 -a android.intent.action.VIEW -d "$1" -n is.xyz.mpv/.MPVActivity -e "title" "$2" >/dev/null 2>&1
|
||||
url=$1
|
||||
title=$2
|
||||
shift 2
|
||||
|
||||
dir="/sdcard/mpv"
|
||||
file="$dir/mpv.config.mp4"
|
||||
if [ -w "${dir%*/.mpv}" ]; then
|
||||
[ -d "${dir}" ] || mkdir "${dir}"
|
||||
printf "%s" "$@" | sed 's| --|\n|g; s|^--||g' > "$file"
|
||||
sleep 10 && : > "$file" &
|
||||
else
|
||||
printf "\n\033[1;31mCannot write\033[0m → %s\n" "$file"
|
||||
printf "\033[1;36mRun:\033[0m termux-setup-storage\n\n"
|
||||
printf "\033[1;36mThen:\033[0m\n"
|
||||
printf "> allow storage permission\n"
|
||||
printf "> add → include='%s'\n" "$file"
|
||||
printf " to MPV → Settings > Advanced > mpv.conf\n"
|
||||
printf " Make sure to press enter after pasting the content above for MPV to recognise it.."
|
||||
fi
|
||||
am start --user 0 -a android.intent.action.VIEW -d "$url" -n is.xyz.mpv/.MPVActivity -e "title" "$title" >/dev/null 2>&1
|
||||
#am start --user 0 -a android.intent.action.VIEW -d "$1" -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e "title" "$2" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
player_linux() {
|
||||
setsid -f mpv "$1" --force-media-title="$2" $3
|
||||
url=$1
|
||||
title=$2
|
||||
shift 2
|
||||
|
||||
setsid -f mpv "$url" --force-media-title="$title" $@
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user