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) [Setup](#setup) | [Usage](#usage) | [Screenshots](#screenshots)
![Aniwrapper screenshot](./screenshots/aniwrapper_home.png) ![Aniwrapper screenshot](./assets/screenshots/aniwrapper_home.png)
</div> </div>
@ -20,11 +20,14 @@
- [Installing](#installing) - [Installing](#installing)
- [Usage](#usage) - [Usage](#usage)
- [aniwrapper](#aniwrapper) - [aniwrapper](#aniwrapper)
- [Option 1: Streaming (Default)](#option-1-streaming-default)
- [ani-cli Script](#ani-cli-script) - [ani-cli Script](#ani-cli-script)
- [Screenshots](#screenshots) - [Screenshots](#screenshots)
<!-- markdown-toc end --> <!-- markdown-toc end -->
---
# Introduction # Introduction
This is a fork of [Dink4n's ani-cli](https://github.com/Dink4n/ani-cli), 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/` 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 # Usage
## aniwrapper ## aniwrapper
@ -99,6 +120,34 @@ Running `sudo make install` copies the `ani-cli` as well as the `aniwrapper` scr
# Launch aniwrapper menu # Launch aniwrapper menu
aniwrapper 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 ## ani-cli Script
# watch anime # watch anime
@ -133,9 +182,9 @@ This would open/download episodes 1 2 3 4 5 6
<div align="center"> <div align="center">
Aniwrapper Main Menu Aniwrapper Main Menu
![aniwrapper frontpage](./screenshots/aniwrapper_home.png) ![aniwrapper frontpage](./assets/screenshots/aniwrapper_home.png)
Aniwrapper Streaming Menu Aniwrapper Streaming Menu
![aniwrapper streaming options](./screenshots/aniwrapper_stream.png) ![aniwrapper streaming options](./assets/screenshots/aniwrapper_stream.png)
More to come soon... maybe More to come soon... maybe
</div> </div>

16
ani-cli
View File

@ -5,6 +5,8 @@ if [[ -z "$XDG_CONFIG_HOME" ]]; then
XDG_CONFIG_HOME="$HOME/.config" XDG_CONFIG_HOME="$HOME/.config"
fi fi
VERBOSE=0
BASE_URL="https://gogoanime.cm" BASE_URL="https://gogoanime.cm"
CFG_DIR="$XDG_CONFIG_HOME/aniwrapper" CFG_DIR="$XDG_CONFIG_HOME/aniwrapper"
ROFI_CFG="meh.rasi" ROFI_CFG="meh.rasi"
@ -26,8 +28,6 @@ c_magenta="\033[1;35m"
c_cyan="\033[1;36m" c_cyan="\033[1;36m"
c_reset="\033[0m" c_reset="\033[0m"
VERBOSE=1
help_text() { help_text() {
while IFS= read line; do while IFS= read line; do
printf "%s\n" "$line" printf "%s\n" "$line"
@ -107,7 +107,8 @@ check_anime_name() {
# Check to make sure passed in name is not empty # Check to make sure passed in name is not empty
[ "$VERBOSE" -eq 1 ] && printf "%s\n" "VAR: $1" [ "$VERBOSE" -eq 1 ] && printf "%s\n" "VAR: $1"
if [[ "$1" == "" ]] || [[ "$1" == " " ]] || [[ "$1" == "\n" ]]; then 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 return 1
fi fi
return 0 return 0
@ -156,6 +157,7 @@ insert_history() {
# check the anime_name/id # check the anime_name/id
check_anime_name "$1" check_anime_name "$1"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "ERROR: Anime name is none... exiting" printf "%s\n" "ERROR: Anime name is none... exiting"
return 1 return 1
fi fi
@ -163,8 +165,10 @@ insert_history() {
check_db "$@" check_db "$@"
if [[ $? -gt 0 ]]; then if [[ $? -gt 0 ]]; then
if [[ "$2" == "search" ]]; then if [[ "$2" == "search" ]]; then
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "Already in search db... Updating search_date" printf "%s\n" "Already in search db... Updating search_date"
else else
[ "$VERBOSE" -eq 1 ] &&
printf "%s\n" "Already in search db... Updating watch_date" printf "%s\n" "Already in search db... Updating watch_date"
fi fi
update_date "$@" update_date "$@"
@ -257,7 +261,7 @@ anime_selection() {
fi fi
done done
printf "%s\n" "SEARCHED: $searched" [ "$VERBOSE" -eq 1 ] && printf "%s\n" "SEARCHED: $searched"
# get the anime from indexed list # get the anime from indexed list
user_input=$(printf "${menu[@]}" | user_input=$(printf "${menu[@]}" |
@ -312,9 +316,9 @@ anime_selection() {
episode_selection() { episode_selection() {
# select episode number for anime # 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 "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 \ stmt="SELECT DISTINCT episode_number \
FROM watch_history \ FROM watch_history \
WHERE anime_name = '$anime_id';" WHERE anime_name = '$anime_id';"

View File

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