feat : made scripts universal and much more complicated

This commit is contained in:
coolnsx
2023-03-07 00:58:02 +05:30
parent aac5a51c73
commit 4c0a0a934a
14 changed files with 366 additions and 168 deletions

18
rss
View File

@@ -1,9 +1,19 @@
#!/bin/sh
tmp=$(notify-send -t 2000 "Parsing SubsPlease RSS... Please Wait..." -p)
if [ "$(uname -o)" = "Android" ]; then
os="droid"
script_dir="$HOME"
else
os="linux"
script_dir="$HOME/repos_scripts"
fi
. $script_dir/.functions
info_$os "Parsing SubsPlease RSS... Please Wait..."
data=$(curl -s "https://subsplease.org/rss/?r=1080" | sed 's/<item>/\n/g')
name=$(printf "%s" "$data" | sed -nE 's_^.*Please\] (.*)</title>.*size>(.*)</subs.*_(\2) > \1_p' | bemenu --fn 'Roboto 16' -i -c -W 0.6 -B 3 -l 25 -p "Search anime:")
[ -z "$name" ] && notify-send -u critical "Err.. Query empty" -r $tmp && exit 0
name=$(printf "%s" "$data" | sed -nE 's_^.*Please\] (.*)</title>.*size>(.*)</subs.*_(\2) > \1_p' | menu_$os "Search Anime: ")
[ -z "$name" ] && exit 0
id=$(printf "%s" "$name" | sed -nE 's/.*\[(.*)\].*/\1/p')
magnet=$(printf "%s" "$data" | sed -nE "s_.*<link>(.*$id.*)</link>.*_\1_p" | sed 's/amp;//g')
setsid -f $TERMINAL -e $HOME/repos_scripts/torrent "$magnet"
torrent_$os "$magnet"