should get thru ci now

This commit is contained in:
2026-06-05 21:03:07 +05:30
parent 73275cb098
commit 197746a5e4
5 changed files with 55 additions and 45 deletions
+18 -9
View File
@@ -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() {
url=$1
title=$2
shift 2
dir="/sdcard/mpv"
file="$dir/mpv.config.mp4"
if [ -w "${dir%*/mpv}" ]; then
if [ -w "${dir%*/.mpv}" ]; then
[ -d "${dir}" ] || mkdir "${dir}"
printf "%s" "$3" | sed 's| --|\n|g; s|^--||g' > "$file"
printf "%s" "$@" | sed 's| --|\n|g; s|^--||g' > "$file"
sleep 10 && : > "$file" &
else
printf "\n\033[1;31mCannot write\033[0m → $file\n"
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='$file'\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 "$1" -n is.xyz.mpv/.MPVActivity -e "title" "$2" >/dev/null 2>&1
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" $@
}
+1 -1
View File
@@ -92,7 +92,7 @@ printf "%s\n" "$url" | while read -r id title; do
stream)
info_$os "opening $title" "mpv"
# shellcheck disable=SC2086
player_$os "$provider_video" "$title" "--referrer='$refer' --tls-verify=no"
player_$os "$provider_video" "$title" --referrer="$refer" --tls-verify=no --user-agent="$agent"
break
;;
cast)
+4 -1
View File
@@ -87,7 +87,10 @@ stop() {
defaultname="screenrecord-$(date +"%F_%H-%M-%S").mp4"
filename=$(: | menu "Enter Filename (default: $defaultname):")
[ -z "$filename" ] && filename=$defaultname
mv "$tmp_file" "$HOME/$filename"
directory="${XDG_VIDEO_DIR:-$HOME/videos}"
[ -d "$directory" ] || mkdir -p "$directory"
mv "$tmp_file" "$directory/$filename"
info "kfloppy" "2000" "Saved as $directory/$filename"
;;
*)
+1 -3
View File
@@ -18,12 +18,10 @@ down() {
magnet="$1"
if [ "$(uname -o)" = "Android" ]; then
os="droid"
script_dir="$HOME/.shortcuts"
download_dir="/sdcard"
[ -z "$magnet" ] && magnet="$(termux-clipboard-get)"
else
os="linux"
script_dir="$HOME/repos_scripts"
download_dir="$HOME/Softwares"
[ -z "$magnet" ] && magnet="$(wl-paste)"
terminal="${TERMINAL:-foot}"
@@ -36,7 +34,7 @@ fi
#import generic functions
# shellcheck source=./.functions
. "$script_dir/.functions"
. "$(dirname "$0")"/.functions
filepath="$HOME/.cache"
#check if the url is magnet
+10 -10
View File
@@ -116,7 +116,7 @@ get_song_lyrics() {
\"client\": {
\"clientName\": \"ANDROID_MUSIC\",
\"clientVersion\": \"$yt_music_ver\",
\"androidSdkVersion\": $((random_no + extra_up + 29)),
\"androidSdkVersion\": $((random_no + 30)),
\"userAgent\": \"$yt_music_agent\",
\"hl\": \"en\",
\"timeZone\": \"UTC\",
@@ -164,7 +164,7 @@ play() {
\"client\": {
\"clientName\": \"ANDROID\",
\"clientVersion\": \"$yt_ver\",
\"androidSdkVersion\": $((random_no + extra_up + 29)),
\"androidSdkVersion\": $((random_no + 30)),
\"userAgent\": \"$yt_agent\",
\"hl\": \"en\",
\"timeZone\": \"UTC\",
@@ -212,7 +212,7 @@ search_play() {
[ -z "$query" ] && notify-send -e "Err.. Search query empty" -u critical -h "string:x-canonical-private-synchronous:${0##*/}" && exit 1
#storing context
printf '{"client":{"clientName":"WEB_REMIX","clientVersion":"1.20250616.03.00"}}' >"$logdir/context"
printf '%s' "$web_context" >"$logdir/context"
#extracting your cookies so that the song list are according to your taste
get_cookies
@@ -277,19 +277,19 @@ base_url="https://music.youtube.com"
cookie="$logdir/cookies"
# user agents, used by script
random_no=$(head /dev/urandom | tr -dc '4-7' | cut -c1)
random_no=$(head /dev/urandom | tr -dc '4-8' | cut -c1)
# web
agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/13$random_no.0.0.0 Safari/537.36"
agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/14$random_no.0.0.0 Safari/537.36"
# random number for android
random_no=$(head /dev/urandom | tr -dc '1-5' | cut -c1)
# android
extra_up=$((random_no > 1))
random_no=$(head /dev/urandom | tr -dc '2-6' | cut -c1)
# youtube
yt_ver="20.23.40"
yt_ver="21.22.165"
yt_agent="com.google.android.youtube/$yt_ver (Linux; U; Android 1$random_no) gzip"
# youtube music
yt_music_ver="8.23.51"
yt_music_ver="9.21.51"
yt_music_agent="com.google.android.apps.youtube.music/$yt_music_ver (Linux; U; Android 1$random_no) gzip"
# web context
web_context='{"client":{"clientName":"WEB_REMIX","clientVersion":"1.20260531.05.00"}}'
#call this script by script-name "function_name" "query"
[ -z "$1" ] && help "$@"