Compare commits
3 Commits
1c0a265455
...
5b9309eaed
Author | SHA1 | Date | |
---|---|---|---|
5b9309eaed | |||
6a1c7bdc46 | |||
e8f3cca8a9 |
@ -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 start -- 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 -e 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"
|
||||
|
@ -21,7 +21,9 @@ menu () {
|
||||
main () {
|
||||
load_config
|
||||
|
||||
menu $@
|
||||
[ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@"
|
||||
|
||||
menu $link
|
||||
}
|
||||
|
||||
main $@
|
||||
|
34
dmenu-rarbg
34
dmenu-rarbg
@ -20,14 +20,19 @@ 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=pirokit" | jq -r '.token')
|
||||
token=$(curl -sLH "User-agent: 'your bot 0.1'" "${base_url}get_token=get_token&app_id=dmenu-rarbg" | jq -r '.token')
|
||||
|
||||
default_args="&token=${token}&limit=100&app_id=pirokit&format=json_extended"
|
||||
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=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}"
|
||||
@ -36,19 +41,24 @@ else
|
||||
fi
|
||||
|
||||
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
|
||||
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");;
|
||||
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";;
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user