update readme and turn off verbose mode

This commit is contained in:
ksyasuda 2021-11-09 00:54:55 -08:00
parent 4b7fccec1c
commit ea63ad4ac8
7 changed files with 178 additions and 126 deletions

View File

@ -4,7 +4,7 @@
[Setup](#setup) | [Usage](#usage) | [Screenshots](#screenshots)
![Aniwrapper screenshot](./screenshots/aniwrapper_home.png)
![Aniwrapper screenshot](./assets/screenshots/aniwrapper_home.png)
</div>
@ -20,11 +20,14 @@
- [Installing](#installing)
- [Usage](#usage)
- [aniwrapper](#aniwrapper)
- [Option 1: Streaming (Default)](#option-1-streaming-default)
- [ani-cli Script](#ani-cli-script)
- [Screenshots](#screenshots)
<!-- markdown-toc end -->
---
# Introduction
This is a fork of [Dink4n's ani-cli](https://github.com/Dink4n/ani-cli),
@ -92,6 +95,24 @@ The setup process consists of:
Running `sudo make install` copies the `ani-cli` as well as the `aniwrapper` scripts to `/usr/local/bin/`
## `aniwrapper` Menus
There are several menus used to drive the program forward
### Search Anime
The first menu consists of a search box and a list of anime titles corresponding to past valid searches. Choose an option from the menu, or enter in a unique search query to search for a new anime. The result from this will be used to query against `gogoanime` and return similar named anime
### Anime Selection
The next menu is where you select the anime to watch from a narrowed down list. Elements that have a blue border and text color indicate which anime have been watched before
- _In the future, I'd like to make it so if you select an option from the list of previously searched anime, then it will skip this and go on to episode selection_
### Episode Selection
In the episode selection menu, you can select an individual episode from the list, provide a single episode, or provide a range of episodes as two space separated integers `start_episode end_episode`. Like in the previous menu, any element with a blue border and text-color indicates that episode has been watched before
# Usage
## aniwrapper
@ -99,6 +120,34 @@ Running `sudo make install` copies the `ani-cli` as well as the `aniwrapper` scr
# Launch aniwrapper menu
aniwrapper
### Option 1: Streaming
<div align="center">
![streaming gif select from menu](./assets/gifs/streaming.gif)
Streaming a previously watched anime
[click here](./assets/gifs/streaming_new.gif) for an example showing streaming a new anime
</div>
Streaming is the default option for the `aniwrapper` script and will prompt you with each of the menus specified in the _[aniwrapper Menus](#aniwrapper-menus)_ section
### Option 2: Download
The default download location is `$HOME/Videos/sauce` and will be chosen as the download directory unless otherwise specified
After specifying the download directory (or leaving it blank for the default), you will be presented with the menus from the _[aniwrapper Menus](#aniwrapper-menus)_ section for selecting the anime and episode(s) to download
### Option 3: Continue
**CURRENTLY BROKEN. WORKING ON FIX**
The continue option queries the `sqlite3` history databse and pulls the list of distinct anime names from the `watch_history` table. Select an option from the list and the most recently watched episode of the selected anime will play
### Option 4: Playlist
_description coming soon_
## ani-cli Script
# watch anime
@ -133,9 +182,9 @@ This would open/download episodes 1 2 3 4 5 6
<div align="center">
Aniwrapper Main Menu
![aniwrapper frontpage](./screenshots/aniwrapper_home.png)
![aniwrapper frontpage](./assets/screenshots/aniwrapper_home.png)
Aniwrapper Streaming Menu
![aniwrapper streaming options](./screenshots/aniwrapper_stream.png)
![aniwrapper streaming options](./assets/screenshots/aniwrapper_stream.png)
More to come soon... maybe
</div>

26
ani-cli
View File

@ -5,6 +5,8 @@ if [[ -z "$XDG_CONFIG_HOME" ]]; then
XDG_CONFIG_HOME="$HOME/.config"
fi
VERBOSE=0
BASE_URL="https://gogoanime.cm"
CFG_DIR="$XDG_CONFIG_HOME/aniwrapper"
ROFI_CFG="meh.rasi"
@ -26,8 +28,6 @@ c_magenta="\033[1;35m"
c_cyan="\033[1;36m"
c_reset="\033[0m"
VERBOSE=1
help_text() {
while IFS= read line; do
printf "%s\n" "$line"
@ -107,7 +107,8 @@ check_anime_name() {
# Check to make sure passed in name is not empty
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "VAR: $1"
if [[ "$1" == "" ]] || [[ "$1" == " " ]] || [[ "$1" == "\n" ]]; then
printf "%s\n" "Passed in name is null"
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "Passed in name is nothing"
return 1
fi
return 0
@ -156,6 +157,7 @@ insert_history() {
# check the anime_name/id
check_anime_name "$1"
if [[ $? -ne 0 ]]; then
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "ERROR: Anime name is none... exiting"
return 1
fi
@ -163,8 +165,10 @@ insert_history() {
check_db "$@"
if [[ $? -gt 0 ]]; then
if [[ "$2" == "search" ]]; then
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "Already in search db... Updating search_date"
else
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "Already in search db... Updating watch_date"
fi
update_date "$@"
@ -257,7 +261,7 @@ anime_selection() {
fi
done
printf "%s\n" "SEARCHED: $searched"
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "SEARCHED: $searched"
# get the anime from indexed list
user_input=$(printf "${menu[@]}" |
@ -312,9 +316,9 @@ anime_selection() {
episode_selection() {
# select episode number for anime
[ $is_download -eq 1 ] &&
[ "$is_download" -eq 1 ] &&
printf "Range of episodes can be specified: start_number end_number\n"
printf "%s\n" "Anime ID: $anime_id"
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "Anime ID: $anime_id"
stmt="SELECT DISTINCT episode_number \
FROM watch_history \
WHERE anime_name = '$anime_id';"
@ -511,7 +515,7 @@ if [[ "$list_history" -eq 1 ]]; then
fi
case $scrape in
query)
query)
get_search_query "$*"
search_results=$(search_anime "$query")
@ -520,7 +524,7 @@ case $scrape in
[ $? -ne 0 ] && die "No anime selection found"
episode_selection
;;
history)
history)
# search_results=$(sed -n -E 's/\t[0-9]*//p' "$logfile")
stmt="SELECT DISTINCT anime_name FROM watch_history ORDER BY watch_date DESC"
search_results=$(printf "%s\n" "$stmt" | sqlite3 -noheader "$HISTORY_DB")
@ -533,7 +537,7 @@ case $scrape in
echo "EPISODE: $ep_choice_start"
# ep_choice_start=$(sed -n -E "s/${selection_id}\t//p" "$logfile")
;;
playlist)
playlist)
lines=$(cat "$playlist_file" | wc -l)
[ "$VERBOSE" -eq 1 ] && printf "%s%d\n" "Num lines in playlist: " "$lines"
if [[ "$lines" -eq 0 ]]; then
@ -559,7 +563,7 @@ case $scrape in
[ "$VERBOSE" -eq 1 ] && printf "Episodes: %s\n" "${episodes[@]}"
fi
;;
add)
add)
get_search_query "$*"
search_results=$(search_anime "$query")
[ -z "$search_results" ] && die "No search results found"
@ -567,7 +571,7 @@ case $scrape in
[ $? -ne 0 ] && die "No anime selection found"
episode_selection
;;
delete) ;;
delete) ;;
esac

View File

@ -7,7 +7,7 @@ DEFAULT_DOWNLOAD="$HOME/Videos/sauce"
DEFAULT_PLAYLIST="$HOME/Videos/sauce/playlists/playlist.txt"
CFG_DIR="$XDG_CONFIG_HOME/aniwrapper"
CFG_FILE="meh.rasi"
VERBOSE=1
VERBOSE=0
# printf "%s\n" "CONFIG DIR: $CFG_DIR"
@ -44,7 +44,6 @@ if [[ "$selection" == "1." ]]; then
# streaming
# ---------------------------------------------------------------------------
log "Streaming mode"
printf "%s\n" "STREAMING..."
run
elif [[ "$selection" == "2." ]]; then
# ---------------------------------------------------------------------------

BIN
assets/gifs/streaming.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 MiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB