Compare commits
No commits in common. "5b9309eaed79fa30b3bb789ab8b9d965187f9608" and "1c0a2654556fa4710612adcc2c35f50c73644f3c" have entirely different histories.
5b9309eaed
...
1c0a265455
@ -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" = "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"
|
[ "$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,9 +21,7 @@ menu () {
|
|||||||
main () {
|
main () {
|
||||||
load_config
|
load_config
|
||||||
|
|
||||||
[ $# -eq 0 ] && link=$(xclip -sel c -o) || link="$@"
|
menu $@
|
||||||
|
|
||||||
menu $link
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
34
dmenu-rarbg
34
dmenu-rarbg
@ -20,19 +20,14 @@ list() {
|
|||||||
done | column -t -s '|' | dmenu -i -l 15 | awk '{print $1}'
|
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?"
|
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
|
default_args="&token=${token}&limit=100&app_id=pirokit&format=json_extended"
|
||||||
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
|
if [ "$query" = "" ]; then
|
||||||
url="${base_url}mode=list${default_args}"
|
url="${base_url}mode=list${default_args}"
|
||||||
@ -41,24 +36,19 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
|
case "$(printf "All\\nMovies\\nTV Shows\\nGames\\nMusic" | dmenu -i -p "Choose category: ")" in
|
||||||
All) url="$url";;
|
All) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}");;
|
||||||
Movies) url="${url}&category=17;44;45;47;50;51;52;42;46;54";;
|
Movies) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=17;44;45;47;50;51;52;42;46;54");;
|
||||||
"TV Shows") url="${url}&category=2;18;41;49";;
|
"TV Shows") response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;18;41;49");;
|
||||||
Games) url="${url}&category=2;27;28;29;30;31;53";;
|
Games) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;27;28;29;30;31;53");;
|
||||||
Music) url="${url}&category=2;23;24;25;26";;
|
Music) response=$(curl -sLH "User-agent: 'your bot 0.1'" "${url}&category=2;23;24;25;26");;
|
||||||
esac
|
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" = "" ] && 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
|
[ "$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')
|
titles=$(printf '%s\n' "$response" | jq -r '.[] | .[].title')
|
||||||
|
|
||||||
seeders=$(printf '%s\n' "$response" | jq -r '.[] | .[].seeders')
|
seeders=$(printf '%s\n' "$response" | jq -r '.[] | .[].seeders')
|
||||||
|
Loading…
Reference in New Issue
Block a user