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() { search_droid() {
printf "%s" "$1" && read -r query printf "\n\033[1;33m%s\033[0m" "$1" && read -r query
} }
search_linux() { search_linux() {
@@ -28,7 +28,7 @@ torrent_droid() {
} }
info_droid() { info_droid() {
printf "\n\r\033[1;36m%s" "$1" printf "\n\r\033[1;36m%s\033[0m" "$1"
} }
info_linux() { info_linux() {
@@ -36,7 +36,7 @@ info_linux() {
} }
error_droid() { error_droid() {
printf "\33[2K\r\033[1;31m%s" "$1" printf "\33[2K\r\033[1;31m%s\033[0m" "$1"
} }
error_linux() { error_linux() {
@@ -44,24 +44,33 @@ error_linux() {
} }
player_droid() { player_droid() {
url=$1
title=$2
shift 2
dir="/sdcard/mpv" dir="/sdcard/mpv"
file="$dir/mpv.config.mp4" file="$dir/mpv.config.mp4"
if [ -w "${dir%*/mpv}" ]; then if [ -w "${dir%*/.mpv}" ]; then
[ -d "${dir}" ] || mkdir "${dir}" [ -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" & sleep 10 && : > "$file" &
else 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;36mRun:\033[0m termux-setup-storage\n\n"
printf "\033[1;36mThen:\033[0m\n" printf "\033[1;36mThen:\033[0m\n"
printf "> allow storage permission\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 " to MPV → Settings > Advanced > mpv.conf\n"
printf " Make sure to press enter after pasting the content above for MPV to recognise it.."
fi 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 #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() { 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) stream)
info_$os "opening $title" "mpv" info_$os "opening $title" "mpv"
# shellcheck disable=SC2086 # 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 break
;; ;;
cast) cast)
+4 -1
View File
@@ -87,7 +87,10 @@ stop() {
defaultname="screenrecord-$(date +"%F_%H-%M-%S").mp4" defaultname="screenrecord-$(date +"%F_%H-%M-%S").mp4"
filename=$(: | menu "Enter Filename (default: $defaultname):") filename=$(: | menu "Enter Filename (default: $defaultname):")
[ -z "$filename" ] && filename=$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" magnet="$1"
if [ "$(uname -o)" = "Android" ]; then if [ "$(uname -o)" = "Android" ]; then
os="droid" os="droid"
script_dir="$HOME/.shortcuts"
download_dir="/sdcard" download_dir="/sdcard"
[ -z "$magnet" ] && magnet="$(termux-clipboard-get)" [ -z "$magnet" ] && magnet="$(termux-clipboard-get)"
else else
os="linux" os="linux"
script_dir="$HOME/repos_scripts"
download_dir="$HOME/Softwares" download_dir="$HOME/Softwares"
[ -z "$magnet" ] && magnet="$(wl-paste)" [ -z "$magnet" ] && magnet="$(wl-paste)"
terminal="${TERMINAL:-foot}" terminal="${TERMINAL:-foot}"
@@ -36,7 +34,7 @@ fi
#import generic functions #import generic functions
# shellcheck source=./.functions # shellcheck source=./.functions
. "$script_dir/.functions" . "$(dirname "$0")"/.functions
filepath="$HOME/.cache" filepath="$HOME/.cache"
#check if the url is magnet #check if the url is magnet
+10 -10
View File
@@ -116,7 +116,7 @@ get_song_lyrics() {
\"client\": { \"client\": {
\"clientName\": \"ANDROID_MUSIC\", \"clientName\": \"ANDROID_MUSIC\",
\"clientVersion\": \"$yt_music_ver\", \"clientVersion\": \"$yt_music_ver\",
\"androidSdkVersion\": $((random_no + extra_up + 29)), \"androidSdkVersion\": $((random_no + 30)),
\"userAgent\": \"$yt_music_agent\", \"userAgent\": \"$yt_music_agent\",
\"hl\": \"en\", \"hl\": \"en\",
\"timeZone\": \"UTC\", \"timeZone\": \"UTC\",
@@ -164,7 +164,7 @@ play() {
\"client\": { \"client\": {
\"clientName\": \"ANDROID\", \"clientName\": \"ANDROID\",
\"clientVersion\": \"$yt_ver\", \"clientVersion\": \"$yt_ver\",
\"androidSdkVersion\": $((random_no + extra_up + 29)), \"androidSdkVersion\": $((random_no + 30)),
\"userAgent\": \"$yt_agent\", \"userAgent\": \"$yt_agent\",
\"hl\": \"en\", \"hl\": \"en\",
\"timeZone\": \"UTC\", \"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 [ -z "$query" ] && notify-send -e "Err.. Search query empty" -u critical -h "string:x-canonical-private-synchronous:${0##*/}" && exit 1
#storing context #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 #extracting your cookies so that the song list are according to your taste
get_cookies get_cookies
@@ -277,19 +277,19 @@ base_url="https://music.youtube.com"
cookie="$logdir/cookies" cookie="$logdir/cookies"
# user agents, used by script # 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 # 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 number for android
random_no=$(head /dev/urandom | tr -dc '1-5' | cut -c1) random_no=$(head /dev/urandom | tr -dc '2-6' | cut -c1)
# android
extra_up=$((random_no > 1))
# youtube # 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" yt_agent="com.google.android.youtube/$yt_ver (Linux; U; Android 1$random_no) gzip"
# youtube music # 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" 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" #call this script by script-name "function_name" "query"
[ -z "$1" ] && help "$@" [ -z "$1" ] && help "$@"