mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 15:25:20 +05:30
accidental commit
This commit is contained in:
28
ani-new
28
ani-new
@@ -3,17 +3,14 @@
|
|||||||
down () {
|
down () {
|
||||||
notify-send "$3 links fetched.." -r "$tmp"
|
notify-send "$3 links fetched.." -r "$tmp"
|
||||||
choice=$(printf "stream\ndownload\nnext mirror" | bemenu --fn 'Roboto 15' -p "??" -i -c -W 0.4 -B 3 -l 10)
|
choice=$(printf "stream\ndownload\nnext mirror" | bemenu --fn 'Roboto 15' -p "??" -i -c -W 0.4 -B 3 -l 10)
|
||||||
[ "$choice" = "stream" ] && setsid -f mpv --referrer="$1" "$2" --force-media-title="$title" && notify-send -i "$icon_dir/apps/mpv.svg" "opening $title" -r "$tmp" && exit 0
|
[ "$choice" = "stream" ] && setsid -f mpv "$2" --force-media-title="$title" && notify-send -i "$icon_dir/apps/mpv.svg" "opening $title" -r "$tmp" && exit 0
|
||||||
[ "$choice" = "next mirror" ] && return 0
|
[ "$choice" = "next mirror" ] && return 0
|
||||||
notify-send -i "$icon_dir/panel/jdownloader-indicator.svg" "Downloading $title" -r "$tmp"
|
notify-send -i "$icon_dir/panel/jdownloader-indicator.svg" "Downloading $title" -r "$tmp"
|
||||||
case $2 in
|
case $2 in
|
||||||
*m3u*)
|
*m3u*) $TERMINAL -e hls -ro "Downloads/$title.mp4" "$2" || (notify-send -u "critical" "Downloading failed $title" -r "$tmp" && exit 0) ;;
|
||||||
$TERMINAL -e ffmpeg -loglevel error -stats -referer "$1" -user_agent "$agent" -i "$2" -c copy "$title.mp4" || (notify-send -u "critical" "Downloading failed $title" -r "$tmp" && exit 0)
|
*) $TERMINAL -e aria2c -U "$agent" --check-certificate=false -d 'Downloads' --summary-interval=0 -x 16 -s 16 --referer="$1" "$2" -o "$title.mp4" --download-result=hide || (notify-send -u "critical" "Downloading failed $title" -r "$tmp" && exit 0) ;;
|
||||||
notify-send "Episode Downloaded $title" -r "$tmp" ;;
|
|
||||||
*)
|
|
||||||
$TERMINAL -e aria2c -U "$agent" --check-certificate=false --summary-interval=0 -x 16 -s 16 --referer="$1" "$2" -o "$title.mp4" --download-result=hide || (notify-send -u "critical" "Downloading failed $title" -r "$tmp" && exit 0)
|
|
||||||
notify-send "Episode Downloaded $title" -r "$tmp" ;;
|
|
||||||
esac
|
esac
|
||||||
|
notify-send "Episode Downloaded $title" -r "$tmp"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +18,10 @@ provider_run(){
|
|||||||
notify-send "Fetching $1 links" -r "$tmp"
|
notify-send "Fetching $1 links" -r "$tmp"
|
||||||
provider_id=$(printf "%s" "$data" | sed -n "$2" | head -1 | cut -d':' -f2)
|
provider_id=$(printf "%s" "$data" | sed -n "$2" | head -1 | cut -d':' -f2)
|
||||||
[ -z "$provider_id" ] && return 0
|
[ -z "$provider_id" ] && return 0
|
||||||
provider_video=$(curl -s "https://blog.allanime.pro/apivtwo/clock.json?id=$provider_id" | sed 's|},{|\n|g' | sed -nE 's|.*link":"([^"]*)".*"resolutionStr":"([^"]*)".*|\1|p' | head -1)
|
provider_video=$(curl -s "https://blog.allanime.pro/apivtwo/clock.json?id=$provider_id" | sed 's|},{|\n|g' | sed -nE 's|.*link":"([^"]*)".*"resolutionStr":"([^"]*)".*|\1|p;s|.*hls","url":"([^"]*)".*"hardsub_lang":"en-US".*|\1|p' | head -1)
|
||||||
[ -z "$provider_video" ] && return 0
|
[ -z "$provider_video" ] && return 0
|
||||||
case $provider_video in
|
case $provider_video in
|
||||||
*v.vrv.co*|*crunchyroll*) down "$base_url" "$(curl -s "$provider_video" -A "$agent" | sed -n '/x1080/{n;p;}')" "$1" ;;
|
*crunchyroll*) down "$base_url" "$(curl -s "$provider_video" -A "$agent" | sed -n '/x1080/{n;p;}')" "$1" ;;
|
||||||
*repackager.wixmp.com*) down "$base_url" "$(printf %s "$provider_video" | cut -d',' -f1,2 | tr -d ',' | sed 's|repackager.wixmp.com/||g')/mp4/file.mp4" "$1" ;;
|
*repackager.wixmp.com*) down "$base_url" "$(printf %s "$provider_video" | cut -d',' -f1,2 | tr -d ',' | sed 's|repackager.wixmp.com/||g')/mp4/file.mp4" "$1" ;;
|
||||||
*) down "$base_url" "$provider_video" "$1" ;;
|
*) down "$base_url" "$provider_video" "$1" ;;
|
||||||
esac
|
esac
|
||||||
@@ -35,19 +32,22 @@ base_url="https://allanime.site"
|
|||||||
agent="Mozilla/5.0"
|
agent="Mozilla/5.0"
|
||||||
trap "exit 0" INT HUP
|
trap "exit 0" INT HUP
|
||||||
tmp=$(notify-send "Parsing $base_url.. Please wait..." -t 1500 -p)
|
tmp=$(notify-send "Parsing $base_url.. Please wait..." -t 1500 -p)
|
||||||
[ -z "$*" ] && url=$(curl -s "$base_url/allanimeapi?variables=%7B%22search%22%3A%7B%22sortBy%22%3A%22Recent%22%2C%22allowAdult%22%3Afalse%2C%22allowUnknown%22%3Afalse%7D%2C%22limit%22%3A40%2C%22page%22%3A1%2C%22translationType%22%3A%22sub%22%2C%22countryOrigin%22%3A%22JP%22%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%229c7a8bc1e095a34f2972699e8105f7aaf9082c6e1ccd56eab99c2f1a971152c6%22%7D%7D" -A "$agent" | sed 's|Show|\n|g' | sed -nE 's|.*_id":"([^"]*)","name":"([^"]*)".*sub":\{"episodeString":"([^"]*)".*|\1\t\2\tepisode \3 sub|p' | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 20 -p "Select Anime: " | tr '[:punct:]' ' ' | tr -s ' ' | tr ' \t' '-/') || url=$*
|
[ -z "$*" ] && url=$(curl -s "$base_url/allanimeapi?variables=%7B%22search%22%3A%7B%22sortBy%22%3A%22Recent%22%2C%22allowAdult%22%3Atrue%2C%22allowUnknown%22%3Atrue%7D%2C%22limit%22%3A40%2C%22page%22%3A1%2C%22translationType%22%3A%22sub%22%2C%22countryOrigin%22%3A%22JP%22%7D&extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%229c7a8bc1e095a34f2972699e8105f7aaf9082c6e1ccd56eab99c2f1a971152c6%22%7D%7D" -A "$agent" | sed 's|Show|\n|g' | sed -nE 's|.*_id":"([^"]*)","name":"([^"]*)".*sub":\{"episodeString":"([^"]*)".*|\1\t\2\tepisode \3|p' | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 20 -p "Select Anime: " | tr '[:punct:]' ' ' | tr -s ' ' | tr ' \t' '-/') || url=$(printf "%s" "$*" | sed -nE 's|.*/watch/(.*)-sub|\1|p')
|
||||||
|
[ -z "$url" ] && notify-send -u "critical" "No anime selected" -r "$tmp" && exit 0
|
||||||
title=$(printf "%s" "$url" | cut -d'/' -f2- | tr '[:punct:]' ' ')
|
title=$(printf "%s" "$url" | cut -d'/' -f2- | tr '[:punct:]' ' ')
|
||||||
url=$(printf "%s" "$url" | cut -d'/' -f1,3)
|
url=$(printf "%s" "$url" | cut -d'/' -f1,3)
|
||||||
[ -z "$url" ] && notify-send -u "critical" "No anime selected" -r "$tmp" && exit 0
|
|
||||||
notify-send "Loading Episode $title.." -r "$tmp"
|
notify-send "Loading Episode $title.." -r "$tmp"
|
||||||
data=$(curl -A "$agent" -s "${base_url}/watch/$url" | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":".*?id=([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p')
|
data=$(curl -A "$agent" -s "${base_url}/watch/$url-sub" | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":".*?id=([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p')
|
||||||
notify-send "Fetching Embed links" -r "$tmp"
|
notify-send "Fetching Embed links" -r "$tmp"
|
||||||
|
|
||||||
#pstatic links
|
#pstatic links
|
||||||
provider_run "pstatic" "/Default B :/p"
|
provider_run "pstatic" "/Default B :/p"
|
||||||
|
|
||||||
#vrv|wixmp links
|
#wixmp links
|
||||||
provider_run "vrv" "/Default :/p"
|
provider_run "wixmp" "/Default :/p"
|
||||||
|
|
||||||
|
#wixmp links
|
||||||
|
provider_run "vrv" "/Ac :/p"
|
||||||
|
|
||||||
#sharepoint links
|
#sharepoint links
|
||||||
provider_run "sharepoint" "/S-mp4 :/p"
|
provider_run "sharepoint" "/S-mp4 :/p"
|
||||||
|
|||||||
5
bkmark
5
bkmark
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
#script for bookmarking selected items and later using it..
|
#script for bookmarking selected items and later using it..
|
||||||
|
|
||||||
data="$(wl-paste -p | tr '\n' '\`')"
|
data="$(wl-paste -p | tr '\n' '\`' | sed 's/$/ /g')"
|
||||||
|
|
||||||
file="$HOME/.cache/bookmarks"
|
file="$HOME/.cache/bookmarks"
|
||||||
|
oshi_file="$HOME/.cache/oshi-urls"
|
||||||
|
|
||||||
if [ "$*" = "add" ];then
|
if [ "$*" = "add" ];then
|
||||||
if [ -z "$data" ];then
|
if [ -z "$data" ];then
|
||||||
@@ -21,7 +22,7 @@ elif [ "$*" = "rm" ];then
|
|||||||
del=$(printf "%s" "$data" | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "delete-bookmark :" | cut -f1)
|
del=$(printf "%s" "$data" | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "delete-bookmark :" | cut -f1)
|
||||||
[ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send "Bookmarked deleted")
|
[ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send "Bookmarked deleted")
|
||||||
else
|
else
|
||||||
wtype -d 5 "$(sed '/^$/d' "$file" | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "Put-bookmark :" | tr '\`' '\n')"
|
wtype -d 10 "$(sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "Put-bookmark :" | tr '\`' '\n')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i '/^$/d' "$file"
|
sed -i '/^$/d' "$file"
|
||||||
|
|||||||
1
yt-music
1
yt-music
@@ -73,6 +73,7 @@ loop(){
|
|||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
pos=$(echo '{ "command": ["get_property", "time-remaining"]}' | socat - /tmp/mpvsocket | sed -nE 's_.*data":([^\.]*).*_\1_p')
|
pos=$(echo '{ "command": ["get_property", "time-remaining"]}' | socat - /tmp/mpvsocket | sed -nE 's_.*data":([^\.]*).*_\1_p')
|
||||||
|
pgrep -f "mpvsocket" >/dev/null || exit 0
|
||||||
[ -z "$pos" ] && pgrep -f "mpvsocket" > /dev/null && [ -n "$(cat "$logdir/next")" ] && play "$(shuf -n1 "$logdir/next")" "$1"
|
[ -z "$pos" ] && pgrep -f "mpvsocket" > /dev/null && [ -n "$(cat "$logdir/next")" ] && play "$(shuf -n1 "$logdir/next")" "$1"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user