mirror of
https://github.com/ksyasuda/aniwrapper.git
synced 2024-11-22 03:19:53 -08:00
only get base_url if scrape is stream or history
This commit is contained in:
parent
b07948cee2
commit
ddb8d01ff2
3
ani-cli
3
ani-cli
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BASE_URL=$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm)
|
||||
CFG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/aniwrapper"
|
||||
HISTORY_DB="$CFG_DIR/history.sqlite3"
|
||||
PLAYER_CMD="mpv"
|
||||
@ -847,9 +846,11 @@ parse_args() {
|
||||
main() {
|
||||
case $scrape in
|
||||
query)
|
||||
BASE_URL=$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm)
|
||||
stream
|
||||
;;
|
||||
history)
|
||||
BASE_URL=$(curl -s -L -o /dev/null -w "%{url_effective}\n" https://gogoanime.cm)
|
||||
stmt="SELECT DISTINCT anime_name FROM watch_history ORDER BY watch_date DESC"
|
||||
search_results=$(printf "%s\n" "$stmt" | sqlite3 -noheader "$HISTORY_DB")
|
||||
[ -z "$search_results" ] && die "History is empty"
|
||||
|
Loading…
Reference in New Issue
Block a user