mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 15:25:20 +05:30
edit rss, tor-cli script
This commit is contained in:
21
rss
21
rss
@@ -4,20 +4,21 @@
|
|||||||
|
|
||||||
#parsing rss file
|
#parsing rss file
|
||||||
notify-send "Parsing SubsPlease RSS... Please Wait..."
|
notify-send "Parsing SubsPlease RSS... Please Wait..."
|
||||||
curl -s https://subsplease.org/rss/?r=720 | tr "><" ">\n<" > $HOME/.cache/rss
|
curl -s https://subsplease.org/rss/?r=720 | tr "<" "\n" > $HOME/.cache/rss
|
||||||
|
|
||||||
#extracting names and providing the menu for selecting particular title
|
#extracting names and providing the menu for selecting particular title
|
||||||
name=$(sed -n -e 's/title>\(\[SubsPlease\].*\)/\1/p' .cache/rss | sed -e 's/\[SubsPlease\] //g' -e 's/(.*//g' | dmenu -l 25 -p "Search anime:")
|
name=$(sed -n -e 's/title>\(\[SubsPlease\].*\)/\1/p' .cache/rss | sed -e 's/\[SubsPlease\] //g' -e 's/(.*//g' | dmenu -l 25 -p "Search anime:")
|
||||||
|
|
||||||
if [ -z "$name" ]; then
|
if [ -z "$name" ]; then
|
||||||
notify-send -u critical "Err.. Query empty"
|
notify-send -u critical "Err.. Query empty"
|
||||||
else
|
exit
|
||||||
#changing the name into format string for pattern matching
|
|
||||||
query=$(printf "$name" | jq -rRs @uri)
|
|
||||||
|
|
||||||
#finding the magnet link containing the exact pattern
|
|
||||||
magnet=$(sed -n -e "s/link>\(.*$query.*\).*/\1/p" .cache/rss)
|
|
||||||
|
|
||||||
#custom script for downloading torrent using aria2c.. you can use your own bittorrent client here
|
|
||||||
st -e $HOME/repos_scripts/torrent "$magnet" &
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#changing the name into format string for pattern matching
|
||||||
|
query=$(printf "$name" | jq -rRs @uri)
|
||||||
|
|
||||||
|
#finding the magnet link containing the exact pattern
|
||||||
|
magnet=$(sed -n -e "s/link>\(.*$query.*\).*/\1/p" .cache/rss)
|
||||||
|
|
||||||
|
#custom script for downloading torrent using aria2c.. you can use your own bittorrent client here
|
||||||
|
st -e $HOME/repos_scripts/torrent "$magnet" &
|
||||||
|
|||||||
18
tor-cli
18
tor-cli
@@ -2,13 +2,7 @@
|
|||||||
|
|
||||||
mkdir -p $HOME/.cache/pirokit
|
mkdir -p $HOME/.cache/pirokit
|
||||||
|
|
||||||
sleep 0.2
|
query=$(printf "" | dmenu -p "Search Torrent: ")
|
||||||
|
|
||||||
if [ -z $1 ]; then
|
|
||||||
query=$(echo "" | dmenu -p "Search Torrent: ")
|
|
||||||
else
|
|
||||||
query=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
baseurl="https://1337x.to"
|
baseurl="https://1337x.to"
|
||||||
cachedir="$HOME/.cache/pirokit"
|
cachedir="$HOME/.cache/pirokit"
|
||||||
@@ -23,10 +17,9 @@ grep -o '<a href="/torrent/.*</a>' $cachedir/tmp.html |
|
|||||||
result_count=$(wc -l $cachedir/titles.bw | awk '{print $1}')
|
result_count=$(wc -l $cachedir/titles.bw | awk '{print $1}')
|
||||||
if [ "$result_count" -lt 1 ]; then
|
if [ "$result_count" -lt 1 ]; then
|
||||||
notify-send "😔 No Result found. Try again 🔴"
|
notify-send "😔 No Result found. Try again 🔴"
|
||||||
exit 0
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Seeders and Leechers
|
# Seeders and Leechers
|
||||||
grep -o '<td class="coll-2 seeds.*</td>\|<td class="coll-3 leeches.*</td>' $cachedir/tmp.html |
|
grep -o '<td class="coll-2 seeds.*</td>\|<td class="coll-3 leeches.*</td>' $cachedir/tmp.html |
|
||||||
sed 's/<[^>]*>//g' | sed 'N;s/\n/ /' > $cachedir/seedleech.bw
|
sed 's/<[^>]*>//g' | sed 'N;s/\n/ /' > $cachedir/seedleech.bw
|
||||||
@@ -41,8 +34,6 @@ grep -E '/torrent/' $cachedir/tmp.html |
|
|||||||
sed -E 's#.*(/torrent/.*)/">.*/#\1#' |
|
sed -E 's#.*(/torrent/.*)/">.*/#\1#' |
|
||||||
sed 's/td>//g' > $cachedir/links.bw
|
sed 's/td>//g' > $cachedir/links.bw
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Clearning up some data to display
|
# Clearning up some data to display
|
||||||
sed 's/\./ /g; s/\-/ /g' $cachedir/titles.bw |
|
sed 's/\./ /g; s/\-/ /g' $cachedir/titles.bw |
|
||||||
sed 's/[^A-Za-z0-9 ]//g' | tr -s " " > $cachedir/tmp && mv $cachedir/tmp $cachedir/titles.bw
|
sed 's/[^A-Za-z0-9 ]//g' | tr -s " " > $cachedir/tmp && mv $cachedir/tmp $cachedir/titles.bw
|
||||||
@@ -56,6 +47,11 @@ LINE=$(paste -d\ $cachedir/size.bw $cachedir/seedleech.bw $cachedir/titles.bw
|
|||||||
cut -d\- -f1 |
|
cut -d\- -f1 |
|
||||||
awk '{$1=$1; print}')
|
awk '{$1=$1; print}')
|
||||||
|
|
||||||
|
if [ -z "$LINE" ]; then
|
||||||
|
notify-send -u critical "Err.. No torrent selected!!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
url=$(head -n $LINE $cachedir/links.bw | tail -n +$LINE)
|
url=$(head -n $LINE $cachedir/links.bw | tail -n +$LINE)
|
||||||
fullURL="${baseurl}${url}/"
|
fullURL="${baseurl}${url}/"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user