diff --git a/ani-cli b/ani-cli index 6753d24..97f722a 100755 --- a/ani-cli +++ b/ani-cli @@ -21,6 +21,7 @@ help_text () { USAGE: $prog -h show this help text -d download episode + -c cast anime EOF } @@ -36,11 +37,7 @@ err () { search_anime () { # get anime name along with its id search=$1 - titlepattern='/dev/null 2>&1 + else + catt cast "$video_url" + fi else printf "Downloading episode $episode ...\n" # add 0 padding to the episode name @@ -195,11 +196,12 @@ open_episode () { ############ # to clear the colors when exited using SIGINT -trap "printf '$c_reset'; rm -f geckodriver.log; exit 1" INT HUP +trap "printf '$c_reset';exit 1" INT HUP # option parsing is_download=0 -while getopts 'hd' OPT; do +is_cast=0 +while getopts 'hdc' OPT; do case $OPT in h) help_text @@ -208,6 +210,9 @@ while getopts 'hd' OPT; do d) is_download=1 ;; + c) + is_cast=1 + ;; esac done shift $((OPTIND - 1)) @@ -272,11 +277,9 @@ while :; do ;; q) - rm -f geckodriver.log break;; *) - rm -f geckodriver.log die "invalid choice" ;; esac diff --git a/bat-status b/bat-status new file mode 100755 index 0000000..3567f4f --- /dev/null +++ b/bat-status @@ -0,0 +1,18 @@ +#! /bin/sh + +capacity=$(cat /sys/class/power_supply/BAT0/charge_full) +voltage=$(cat /sys/class/power_supply/BAT0/voltage_now) +percent=$(cat /sys/class/power_supply/BAT0/capacity) +current=$(cat /sys/class/power_supply/BAT0/current_now) +cap_now=$(cat /sys/class/power_supply/BAT0/charge_now) +health="$(cat /sys/class/power_supply/BAT0/capacity_level)" +stats="$(cat /sys/class/power_supply/BAT0/status)" + +printf "Capacity : %.02f Ah\n" "$((capacity/1000))e-3" +printf "Status : %s\n" "$health" +printf "Percentage : %s\n" "$percent" +printf "State : %s\n" "$stats" +printf "Capacity now : %.02f Ah\n" "$((cap_now/1000))e-3" +printf "Voltage now : %.02f V\n" "$((voltage/1000))e-3" +printf "Current now : %.02f A\n" "$((current/1000))e-3" +printf "Wattage now : %.02f W\n" "$(((voltage*current)/1000000))e-6" diff --git a/lol b/lol new file mode 100755 index 0000000..0004b58 --- /dev/null +++ b/lol @@ -0,0 +1,15 @@ +#!/bin/sh + +ajax_url='https://gogoplay.io/encrypt-ajax.php' + + +#get the id from the url +video_id=$(echo "$*" | cut -d\? -f2 | cut -d\& -f1 | sed 's/id=//g') + +#construct ajax parameters +secret_key='3235373436353338353932393338333936373634363632383739383333323838' +iv='34323036393133333738303038313335' +ajax=$(echo -n -e $video_id | openssl enc -aes256 -K $secret_key -iv $iv -a) + +#send the request to the ajax url +curl -H 'x-requested-with:XMLHttpRequest' "$ajax_url" -d "id=$ajax" -d "time=69420691337800813569" | jq -r '.source[].file' diff --git a/lol.py b/lol.py deleted file mode 100644 index 753e546..0000000 --- a/lol.py +++ /dev/null @@ -1,14 +0,0 @@ -from selenium import webdriver -import sys - -try: - chromeop = webdriver.FirefoxOptions() - chromeop.add_argument("--headless") - temp = webdriver.Firefox(options=chromeop) - temp.get(sys.argv[1]) - print(temp.page_source) -finally: - try: - temp.close() - except: - pass diff --git a/torrent b/torrent index e8fd0e4..5e624cb 100755 --- a/torrent +++ b/torrent @@ -1,13 +1,34 @@ #!/bin/sh +full_tor(){ + notify-send "Torrent:Rukk ja cheecha Download ho rha hai" + aria2c -d $2 --seed-time=0 "$1" && notify-send "Torrent:cheecha download hogyi" || notify-send -u critical "Torrent:cheecha error!!" +} + +part_tor(){ + aria2c --dir=$HOME/.cache --bt-metadata-only=true --bt-save-metadata=true "$1" + aria2c --show-files=true $HOME/.cache/*.torrent + printf "Enter index of the file to download:" + read -r ind + notify-send "Torrent:Rukk ja cheecha Download ho rha hai" + aria2c --select-file=$ind -d $2 --seed-time=0 $HOME/.cache/*.torrent && notify-send "Torrent:cheecha download hogyi" || notify-send -u critical "Torrent:cheecha error!!" + rm -f $HOME/.cache/*.torrent + +} + if [ -z "$*" ]; then magnet="$(xclip -out clipboard)" else magnet=$* fi -x=$(printf "MOVIES\\nSoftwares" | dmenu -p "Select Directory :" | tr -d '\n') - -notify-send "Torrent:Rukk ja cheecha Download ho rha hai" echo "$magnet" -aria2c -d $x --seed-time=0 "$magnet" && notify-send "Torrent:cheecha download hogyi" || notify-send -u critical "Torrent:cheecha error!!" +x=$(printf "MOVIES\\nSoftwares" | dmenu -p "Select Directory :" | tr -d '\n') +printf "Download>>>\n[f]ull torrent\n[p]artial torrent\n\tenter choice:" +read -r ch +case $ch in + f) + full_tor "$magnet" "$x";; + p) + part_tor "$magnet" "$x";; +esac