mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
fix querying anime
This commit is contained in:
parent
44e834c3de
commit
28666ca70a
13
ani-cli
13
ani-cli
@ -5,6 +5,7 @@ if [[ -z "$XDG_CONFIG_HOME" ]]; then
|
||||
XDG_CONFIG_HOME="$HOME/.config"
|
||||
fi
|
||||
|
||||
BASE_URL="https://gogoanime.cm"
|
||||
CFG_DIR="$XDG_CONFIG_HOME/ani-cli"
|
||||
ROFI_CFG="meh.rasi"
|
||||
|
||||
@ -52,21 +53,17 @@ err() {
|
||||
search_anime() {
|
||||
# get anime name along with its id
|
||||
search=$(printf '%s' "$1" | tr ' ' '-')
|
||||
titlepattern='<a href="/category/'
|
||||
|
||||
curl -s "https://gogoanime.pe//search.html" \
|
||||
curl -s "$BASE_URL//search.html" \
|
||||
-G \
|
||||
-d "keyword=$search" |
|
||||
sed -n -E '
|
||||
s_^[[:space:]]*<a href="/category/([^"]*)" title="([^"]*)".*_\1_p
|
||||
'
|
||||
sed -n -E 's_^[[:space:]]*<a href="/category/([^"]*)" title="([^"]*)".*_\1_p'
|
||||
}
|
||||
|
||||
search_eps() {
|
||||
# get available episodes for anime_id
|
||||
anime_id=$1
|
||||
|
||||
curl -s "https://gogoanime.pe/category/$anime_id" |
|
||||
curl -s "$BASE_URL/category/$anime_id" |
|
||||
sed -n -E '
|
||||
/^[[:space:]]*<a href="#" class="active" ep_start/{
|
||||
s/.* '\''([0-9]*)'\'' ep_end = '\''([0-9]*)'\''.*/\2/p
|
||||
@ -80,7 +77,7 @@ get_dpage_link() {
|
||||
anime_id=$1
|
||||
ep_no=$2
|
||||
|
||||
curl -s "https://gogoanime.pe/$anime_id-episode-$ep_no" |
|
||||
curl -s "$BASE_URL/$anime_id-episode-$ep_no" |
|
||||
sed -n -E '
|
||||
/^[[:space:]]*<li class="dowloads">/{
|
||||
s/.*href="([^"]*)".*/\1/p
|
||||
|
Loading…
Reference in New Issue
Block a user