2021-11-08 00:37:08 -08:00
< div align = "center" >
# Aniwrapper
2021-12-15 17:42:16 -08:00
[**_Setup_** ](#setup ) | [**_Usage_** ](#usage ) | [**_Screenshots_** ](#screenshots )
2021-11-08 00:37:08 -08:00
2022-02-01 01:25:08 -08:00
![Aniwrapper screenshot ](https://imgur.com/HFq5gCq.png )
2021-11-08 00:37:08 -08:00
< / div >
2021-12-15 17:42:16 -08:00
# Introduction
This is a fork of [Dink4n's ani-cli ](https://github.com/Dink4n/ani-cli ),
which itself is a fork of
pystardust's [old-ani-cli ](https://github.com/pystardust/ani-cli/tree/old-ani-cli )
2022-01-02 15:14:39 -08:00
This fork is a wrapper around a modified version of ani-cli, which uses [rofi ](https://github.com/davatorium/rofi )
2022-02-01 01:25:08 -08:00
to gather information and control the program flow.
2021-12-15 17:42:16 -08:00
In addition to `rofi` , I've also changed the way saving history works by
integrating a local [sqlite3 ](https://www.sqlite.org/index.html ) database with a table for
2022-02-01 01:25:08 -08:00
search, watch, and file history
2021-12-15 17:42:16 -08:00
2022-01-02 15:14:39 -08:00
While this is a fork of a fork of pystardust's old-ani-cli, I would call this more of a light fork of the [the main ani-cli ](https://github.com/pystardust/ani-cli ).
2022-02-01 01:25:08 -08:00
I have implemented most of the main features from the original script and continue to use the same scraping logic
2021-12-15 17:42:16 -08:00
2022-01-02 15:14:39 -08:00
This tool scrapes the site [gogoanime ](https://gogoanime.cm ).
2021-12-15 17:42:16 -08:00
2021-11-08 00:37:08 -08:00
<!-- markdown - toc start - Don't edit this section. Run M - x markdown - toc - refresh - toc -->
**Table of Contents**
2022-01-02 23:56:25 -08:00
- [Introduction ](#introduction )
- [Setup ](#setup )
- [Skip Intro Script ](#skip-intro-script )
- [Installing ](#installing )
- [Arch Linux ](#arch-linux )
- [Manual Install ](#manual-install )
- [Run the setup and install the script ](#run-the-setup-and-install-the-script )
- [Aniwrapper Menus ](#aniwrapper-menus )
- [Search Anime ](#search-anime )
- [Dealing with conflicting search queries / rofi grabbing from search list ](#dealing-with-conflicting-search-queries--rofi-grabbing-from-search-list )
- [Anime Selection ](#anime-selection )
- [Episode Selection ](#episode-selection )
- [Usage ](#usage )
- [aniwrapper ](#aniwrapper-1 )
- [Option 1: Streaming ](#option-1-streaming )
- [Option 2: Download ](#option-2-download )
- [Option 3: Continue ](#option-3-continue )
- [Option 4: Play from File ](#option-4-play-from-file )
- [Option 5: Sync History ](#option-5-sync-history )
2022-02-01 01:25:08 -08:00
- [Option 6: Choose Theme ](#option-6-choose-theme )
2022-01-02 23:56:25 -08:00
- [ani-cli ](#ani-cli )
- [Screenshots ](#screenshots )
2021-11-08 00:37:08 -08:00
<!-- markdown - toc end -->
# Setup
These are the minimum dependences required to run `aniwrapper`
2022-01-02 15:14:39 -08:00
```
2022-01-04 12:25:22 -08:00
aria2 curl grep mpv rofi sed sqlite3
2022-01-02 15:14:39 -08:00
```
2021-11-08 00:37:08 -08:00
2021-12-30 11:57:16 -08:00
## Skip Intro Script
2021-12-15 17:42:16 -08:00
_This repo comes packaged with and will install the
[skip-intro.lua ](https://github.com/rui-ddc/skip-intro )
script for MPV during setup if it is not already installed_
2022-01-02 15:14:39 -08:00
**The script is activated with the `TAB` key**
2021-12-15 17:42:16 -08:00
Upon activation, the skip-intro script will try its best to skip the
episode introduction by skipping to the next moment of silence in the video
2022-01-02 23:56:25 -08:00
- If the video has not pre-loaded past the introduction, the script will not
know what to do. Press `TAB` again to stop the script until the video
has loaded enough, or just manually skip past the intro.
- If the video does not have a pause in audio (or a significant enough drop in
audio volume) between the end of the introduction and the beginning of the
video/episode, then the script may fail and skip to a random point in the
video
2021-12-15 17:42:16 -08:00
2021-11-20 13:50:12 -08:00
## Installing
2021-11-08 00:37:08 -08:00
### Arch Linux
2022-01-01 18:59:11 -08:00
`aniwrapper-git` is available on the [AUR ](https://aur.archlinux.org/packages/aniwrapper-git/ ) for Arch users
2021-11-20 13:50:12 -08:00
```sh
paru -S aniwrapper-git
or
yay -S aniwrapper-git
```
### Manual Install
2022-02-01 01:25:08 -08:00
Install the Dependencies
2021-11-20 13:50:12 -08:00
2021-11-08 00:37:08 -08:00
```sh
2021-11-26 17:56:06 -08:00
# Arch
2022-01-04 12:25:22 -08:00
pacman -S --needed aria2 curl grep mpv rofi sed sqlite3
2021-11-26 17:56:06 -08:00
# Debian
2022-01-04 12:25:22 -08:00
apt install aria2 curl grep mpv rofi sed sqlite3
2021-11-08 00:37:08 -08:00
```
2022-02-01 01:25:08 -08:00
Clone and switch into the repo directory
2021-11-08 00:37:08 -08:00
```sh
2021-11-26 17:56:06 -08:00
git clone https://github.com/ksyasuda/aniwrapper & & cd aniwrapper
2021-11-08 00:37:08 -08:00
```
2022-01-01 18:59:11 -08:00
#### Run the setup and install the script
2021-11-26 17:56:06 -08:00
2022-01-02 23:56:25 -08:00
From the `aniwrapper` directory, run the following commands to set up and install the script
2021-06-09 05:25:23 -07:00
2021-11-08 01:49:05 -08:00
```sh
chmod +x setup.sh
./setup.sh & & sudo make install
```
2021-07-16 05:13:09 -07:00
2021-11-20 13:50:12 -08:00
# Aniwrapper Menus
2021-11-09 00:54:55 -08:00
There are several menus used to drive the program forward
2021-11-20 13:50:12 -08:00
## Search Anime
2021-11-09 00:54:55 -08:00
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
2022-02-01 01:25:08 -08:00
If selecting an anime from the provided list, the [anime selection ](#anime-selection ) menu will be skipped and the program will move on to [episode selection ](#episode-selection ) for the chosen anime
2022-01-01 19:15:04 -08:00
2022-01-01 18:59:11 -08:00
### Dealing with conflicting search queries / rofi grabbing from search list
2022-01-03 17:00:01 -08:00
In this program, rofi is configured to search with case insensitivity and select the best match from the list if there are matches. This can make it difficult at times to write a search query that does not trigger a selection from the rofi menu
2022-01-01 18:59:11 -08:00
< div align = "center" >
![selection with query 'isekai' ](https://imgur.com/c2U4kdn.png )
Once your history starts filling up, it becomes progressively more difficult to form unique search queries
2022-01-01 19:15:04 -08:00
![selection with dash ](https://imgur.com/vSyaoG6.png )
2022-01-29 01:16:40 -08:00
The workaround for this is to append a dash ` -` to the end of the search query< br />
2022-01-01 18:59:11 -08:00
The above output was produced by searching: `isekai -`
< / div >
2021-11-20 13:50:12 -08:00
## Anime Selection
2021-11-09 00:54:55 -08:00
2022-02-01 01:25:08 -08:00
The next menu is where you select the anime to watch from a narrowed down list of candidates. Titles that are highlighed in blue indicate that anime has been selected before
2021-11-09 00:54:55 -08:00
2021-11-20 13:50:12 -08:00
## Episode Selection
2021-11-09 00:54:55 -08:00
2022-01-02 15:14:39 -08:00
> Half-episodes (ex. saihate-no-paladin episode 7.5) are selectable, however they will not show up in the episodes list.
> To select half episodes add 'h' to the beginning for episodes like '7.5' -> 'h7' to select saihate-no-paladin episode 7.5
2022-02-01 01:25:08 -08:00
Here you will be prompted to select the episode(s) to watch/download
2022-01-02 15:14:39 -08:00
2022-02-01 01:25:08 -08:00
Multiple episodes can be downloaded by giving the episode range like so
2022-01-02 15:14:39 -08:00
```
Select Episode [1-13]: 1 6
```
This would open/download episodes 1 2 3 4 5 6
2021-11-08 01:49:05 -08:00
# Usage
2021-06-09 05:25:23 -07:00
2021-11-08 01:49:05 -08:00
## aniwrapper
2021-11-02 15:18:23 -07:00
2022-01-02 15:14:39 -08:00
```
# Launch menu (default video quality: best)
aniwrapper
2021-11-02 15:18:23 -07:00
2022-01-02 15:14:39 -08:00
# Launch menu with quality selection
aniwrapper -q
2021-12-31 17:03:38 -08:00
2022-01-02 15:14:39 -08:00
# Enable verbose logging
aniwrapper -v
2021-12-31 17:03:38 -08:00
2022-01-08 15:06:55 -08:00
# Connect to history database
aniwrapper -C
2022-01-29 01:09:54 -08:00
# Enable silent mode (suppress output to stdout) [cannot be used with -v]
aniwrapper -S
2022-01-08 15:06:55 -08:00
# Query the history database
aniwrapper -Q < query >
2022-01-06 02:00:37 -08:00
# Choose rofi theme from presets
2022-01-14 12:05:49 -08:00
aniwrapper -t < aniwrapper ( default ) | dracula | doomone | fancy | flamingo | material | nord | onedark >
2022-01-06 23:43:44 -08:00
# Specify custom rofi config
aniwrapper -T < path_to_config >
2022-01-06 02:00:37 -08:00
# Specify starting directory for play_from_file mode, bypassing main menu
2022-01-09 02:33:29 -08:00
aniwrapper -f < starting_directory >
2022-01-06 02:00:37 -08:00
2022-01-02 15:14:39 -08:00
# Use ani-cli command-line mode (rofi disabled)
aniwrapper -c
2021-12-31 17:03:38 -08:00
2022-01-02 15:14:39 -08:00
# Download anime in command-line mode
aniwrapper -d
```
2021-11-09 00:54:55 -08:00
2021-12-31 17:03:38 -08:00
### Option 1: Streaming
2021-11-09 00:54:55 -08:00
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
2022-02-01 01:25:08 -08:00
< details >
< summary > Example< / summary >
2022-02-01 01:37:21 -08:00
![example ](https://imgur.com/wNoXjLX.gif )
2022-02-01 01:25:08 -08:00
< / details >
2021-11-09 00:54:55 -08:00
### 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
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
2021-12-31 17:03:38 -08:00
### Option 4: Play from File
2021-11-09 00:54:55 -08:00
2022-01-02 23:56:25 -08:00
This option prompts you to provide the path to your `Videos` directory. Any path can be provided, but the script will begin the search from the provided path. From there, follow the prompts to select the video you want to watch and it will be opened in `mpv`
2021-11-09 00:54:55 -08:00
2022-02-01 01:25:08 -08:00
< details >
< summary > Example< / summary >
2022-02-01 01:37:21 -08:00
![example ](https://imgur.com/ODB3lBu.gif )
2022-02-01 01:25:08 -08:00
< / details >
2021-11-12 19:22:18 -08:00
### Option 5: Sync History
This option allows you to sync your search/watch history across devices. It queries the database on the remote machine and inserts/updates the necessary rows
At the moment, the requirements are as follows:
2022-01-02 23:56:25 -08:00
- You must be able to `ssh` into the remote machine
- The username must be the same across both devices
- The `history.sqlite3` file must be in the default location: `$XDG_CONFIG_HOME/aniwrapper/history.sqlite3`
2021-11-12 19:22:18 -08:00
2022-02-01 01:25:08 -08:00
### Option 6: Choose Theme
Allows for changing the aniwrapper theme from the main menu
< details >
< summary > Example< / summary >
![example ](https://imgur.com/o97YqLe.gif )
< / details >
2022-01-02 15:14:39 -08:00
## ani-cli
2021-06-10 03:48:06 -07:00
2022-01-02 15:14:39 -08:00
```
# watch anime
ani-cli < query >
2021-06-13 04:34:16 -07:00
2022-01-06 02:00:37 -08:00
# verbose logging
ani-cli -v
2022-01-02 15:14:39 -08:00
# download anime
ani-cli -d < download_directory >
2021-12-31 17:03:38 -08:00
2022-01-02 15:14:39 -08:00
# resume watching anime
ani-cli -H
2021-06-13 04:34:16 -07:00
2022-01-02 15:14:39 -08:00
# sync history across devices
ani-cli -s
2021-06-09 05:25:23 -07:00
2022-01-06 02:00:37 -08:00
# choose quality
2022-01-14 12:05:49 -08:00
ani-cli -q < best ( default ) | 1080p | 720p | 480p | 360p | worst >
2022-01-06 02:00:37 -08:00
# choose rofi theme from presets
2022-01-09 02:33:29 -08:00
ani-cli -t < aniwrapper ( default ) | dracula | fancy | flamingo | material | nord | onedark >
2022-01-06 02:00:37 -08:00
# Specify starting directory for play_from_file mode (does not work with -c)
2022-01-09 02:33:29 -08:00
ani-cli -f < starting_directory >
2022-01-06 02:00:37 -08:00
2022-01-02 15:14:39 -08:00
# run ani-cli in command-line mode (rofi disabled)
ani-cli -c
```
2021-11-08 01:49:05 -08:00
# Screenshots
2022-02-01 01:25:08 -08:00
< div align = "center" >
Main Menu (default theme)
2021-11-08 01:49:05 -08:00
2022-02-01 01:25:08 -08:00
![aniwrapper main menu ](https://imgur.com/HFq5gCq.png )
2022-01-01 18:59:11 -08:00
2022-02-01 01:25:08 -08:00
| | |
| :---------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------: |
| < details >< summary > doom-one</ summary > ![doomone ](https://imgur.com/zMU0i8l.png ) </ details > | < details >< summary > dracula</ summary > ![dracula ](https://imgur.com/BPdIuX3.png )</ details > |
| < details > < summary > fancy< / summary > ![fancy](https://imgur.com/CZx73NL.png)< / details > | < details > < summary > material< / summary > ![material](https://imgur.com/eTWkxw2.png)< / details > |
| < details > < summary > onedark< / summary > ![onedark](https://imgur.com/rchqtBm.png)< / details > | < details > < summary > flamingo (sidebar theme)< / summary > ![flamingo-theme](https://imgur.com/pxF7hRE.png)< / details > |
2021-11-08 01:49:05 -08:00
< / div >