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"
|
XDG_CONFIG_HOME="$HOME/.config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
BASE_URL="https://gogoanime.cm"
|
||||||
CFG_DIR="$XDG_CONFIG_HOME/ani-cli"
|
CFG_DIR="$XDG_CONFIG_HOME/ani-cli"
|
||||||
ROFI_CFG="meh.rasi"
|
ROFI_CFG="meh.rasi"
|
||||||
|
|
||||||
@ -52,21 +53,17 @@ err() {
|
|||||||
search_anime() {
|
search_anime() {
|
||||||
# get anime name along with its id
|
# get anime name along with its id
|
||||||
search=$(printf '%s' "$1" | tr ' ' '-')
|
search=$(printf '%s' "$1" | tr ' ' '-')
|
||||||
titlepattern='<a href="/category/'
|
curl -s "$BASE_URL//search.html" \
|
||||||
|
|
||||||
curl -s "https://gogoanime.pe//search.html" \
|
|
||||||
-G \
|
-G \
|
||||||
-d "keyword=$search" |
|
-d "keyword=$search" |
|
||||||
sed -n -E '
|
sed -n -E 's_^[[:space:]]*<a href="/category/([^"]*)" title="([^"]*)".*_\1_p'
|
||||||
s_^[[:space:]]*<a href="/category/([^"]*)" title="([^"]*)".*_\1_p
|
|
||||||
'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
search_eps() {
|
search_eps() {
|
||||||
# get available episodes for anime_id
|
# get available episodes for anime_id
|
||||||
anime_id=$1
|
anime_id=$1
|
||||||
|
|
||||||
curl -s "https://gogoanime.pe/category/$anime_id" |
|
curl -s "$BASE_URL/category/$anime_id" |
|
||||||
sed -n -E '
|
sed -n -E '
|
||||||
/^[[:space:]]*<a href="#" class="active" ep_start/{
|
/^[[:space:]]*<a href="#" class="active" ep_start/{
|
||||||
s/.* '\''([0-9]*)'\'' ep_end = '\''([0-9]*)'\''.*/\2/p
|
s/.* '\''([0-9]*)'\'' ep_end = '\''([0-9]*)'\''.*/\2/p
|
||||||
@ -80,7 +77,7 @@ get_dpage_link() {
|
|||||||
anime_id=$1
|
anime_id=$1
|
||||||
ep_no=$2
|
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 '
|
sed -n -E '
|
||||||
/^[[:space:]]*<li class="dowloads">/{
|
/^[[:space:]]*<li class="dowloads">/{
|
||||||
s/.*href="([^"]*)".*/\1/p
|
s/.*href="([^"]*)".*/\1/p
|
||||||
|
Loading…
Reference in New Issue
Block a user