Compare commits

..

No commits in common. "5b9309eaed79fa30b3bb789ab8b9d965187f9608" and "1c0a2654556fa4710612adcc2c35f50c73644f3c" have entirely different histories.

3 changed files with 14 additions and 26 deletions

View File

@ -6,6 +6,6 @@
[ "$1" = "open" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Open bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r buku --nostdin -o
[ "$1" = "edit" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r $TERMINAL -e buku -w
[ "$1" = "edit" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r $TERMINAL start -- buku -w
[ "$1" = "delete" ] && buku --nostdin -p -f5 | sed 's/\t/;/g' | column -t -s ';' | $DMENU -p "Edit bookmark: " -i -l 10 | cut -d' ' -f1 | xargs -r -I % buku --nostdin -d % --tacit && notify-send "Deleted bookmark"

View File

@ -21,9 +21,7 @@ menu () {
main () {
load_config
[ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@"
menu $link
menu $@
}
main $@

View File

@ -20,19 +20,14 @@ list() {
done | column -t -s '|' | dmenu -i -l 15 | awk '{print $1}'
}
query=$(printf '%s' | dmenu -i -p "Enter search term: " | sed 's/ /%20/g')
base_url="https://torrentapi.org/pubapi_v2.php?"
token=$(curl -sLH "User-agent: 'your bot 0.1'" "${base_url}get_token=get_token&app_id=dmenu-rarbg" | jq -r '.token')
token=$(curl -sLH "User-agent: 'your bot 0.1'" "${base_url}get_token=get_token&app_id=pirokit" | jq -r '.token')
while [ "$token" = "" ]; do
token=$(curl -sLH "User-agent: 'your bot 0.1'" "${base_url}get_token=get_token&app_id=dmenu-rarbg" | jq -r '.token')
notify-send "RARGB" "Waiting 5 second for api limit to reset"
sleep 5
done
default_args="&token=${token}&limit=100&app_id=pirokit&format=json_extended"
default_args="&token=${token}&limit=100&app_id=dmenu-rarbg&format=json_extended"
query=$(printf '%s' | dmenu -i -p "Enter search term: " | sed 's/ /%20/g')
if [ "$query" = "" ]; then
url="${base_url}mode=list${default_args}"
@ -41,24 +36,19 @@ else
fi
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
All) url="$url";;
Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54";;
"TV Shows") url="${url}&category=2;18;41;49";;
Games) url="${url}&category=2;27;28;29;30;31;53";;
Music) url="${url}&category=2;23;24;25;26";;
All) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}");;
Movies) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=17;44;45;47;50;51;52;42;46;54");;
"TV Shows") response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;18;41;49");;
Games) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;27;28;29;30;31;53");;
Music) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;23;24;25;26");;
esac
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}" )
while [ "$response" = "" ]; do
response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}" )
notify-send "RARGB" "Waiting 5 second for api limit to reset"
sleep 5
done
[ "$response" = "" ] && notify-send "RARBG" "Wait for 3 seconds for api to work." && exit 1
[ "$response" = '{"error":"No results found","error_code":20}' ] && notify-send "RARBG" "No results found" && exit 1
# echo "$response" | jq '.'
# exit 1
titles=$(printf '%s\n' "$response" | jq -r '.[] | .[].title')
seeders=$(printf '%s\n' "$response" | jq -r '.[] | .[].seeders')