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
2021-12-31 17:03:38 -08:00
![Aniwrapper screenshot ](https://imgur.com/bhea2u3.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 )
This fork is a wrapper around a modified version of ani-cli
and uses [rofi ](https://github.com/davatorium/rofi ) to gather information and control the program
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
search and watch history
It is built around Dink4n's fork of ani-cli since at the time of
creation, this is the version that has downloading working correctly
This tool scrapes the site [gogoanime ](https://gogoanime.vc ).
It is intended to be called from the wrapper script `aniwrapper` ,
however using the ani-cli script itself is also possible
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**
2021-12-30 11:57:16 -08:00
- [Aniwrapper ](#aniwrapper )
2021-11-08 01:49:05 -08:00
- [Introduction ](#introduction )
2021-11-08 00:37:08 -08:00
- [Setup ](#setup )
2021-12-30 11:57:16 -08:00
- [Skip Intro Script ](#skip-intro-script )
- [Installing ](#installing )
- [Arch Linux ](#arch-linux )
- [Manual Install ](#manual-install )
- [Install the Dependencies ](#install-the-dependencies )
- [Clone the repo ](#clone-the-repo )
- [Run the setup and install the script ](#run-the-setup-and-install-the-script )
2021-11-20 13:50:12 -08:00
- [Aniwrapper Menus ](#aniwrapper-menus )
2021-12-30 11:57:16 -08:00
- [Search Anime ](#search-anime )
- [Anime Selection ](#anime-selection )
- [Episode Selection ](#episode-selection )
2021-11-08 01:49:05 -08:00
- [Usage ](#usage )
2021-12-30 11:57:16 -08:00
- [aniwrapper ](#aniwrapper-1 )
- [Option 1: Streaming ](#option-1-streaming )
- [Option 2: Download ](#option-2-download )
- [Option 3: Continue ](#option-3-continue )
2021-12-31 17:03:38 -08:00
- [Option 4: Play from File ](#option-4-play-from-file )
2021-12-30 11:57:16 -08:00
- [Option 5: Sync History ](#option-5-sync-history )
- [ani-cli Script ](#ani-cli-script )
2021-11-08 01:49:05 -08:00
- [Screenshots ](#screenshots )
2021-11-08 00:37:08 -08:00
<!-- markdown - toc end -->
# Setup
These are the minimum dependences required to run `aniwrapper`
- grep
- curl
- sed
- mpv
- ffmpeg
- rofi
- meh.rasi (installed in setup.sh)
- sqlite3
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_
The script is activated with the `TAB` key
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
- 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-11-20 13:50:12 -08:00
## Installing
2021-11-08 00:37:08 -08:00
### Arch Linux
2021-11-20 13:50:12 -08:00
`aniwrapper-git` is available on the AUR for Arch users
```sh
paru -S aniwrapper-git
or
yay -S aniwrapper-git
```
### Manual Install
To install manually, make sure the dependencies are installed first
2021-11-26 17:56:06 -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
2021-11-08 00:37:08 -08:00
pacman -S --needed grep curl sed mpv ffmpeg rofi sqlite3
2021-11-26 17:56:06 -08:00
# Debian
2021-12-15 17:42:16 -08:00
apt install grep curl sed mpv ffmpeg rofi sqlite3
2021-11-08 00:37:08 -08:00
```
2021-11-26 17:56:06 -08:00
### Clone the repo
Use the following command to clone the Git repository locally and switch into the cloned 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
```
2021-12-15 17:42:16 -08:00
### Run the setup and install the script
2021-11-26 17:56:06 -08:00
2021-11-20 13:50:12 -08:00
After switching into 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
2021-11-20 13:50:12 -08:00
## Anime Selection
2021-11-09 00:54:55 -08:00
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_
2021-11-20 13:50:12 -08:00
## Episode Selection
2021-11-09 00:54:55 -08:00
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
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
2021-12-31 17:03:38 -08:00
# Launch menu (default video quality: best)
2021-11-02 15:18:23 -07:00
aniwrapper
2021-12-31 17:03:38 -08:00
# Launch menu with quality selection
aniwrapper -q
# Enable verbose logging
aniwrapper -v
# Use ani-cli command-line mode (rofi disabled)
aniwrapper -c
# Download anime in command-line mode
aniwrapper -d
# All flags can be used in command-line mode as well
# ex. The following command will launch aniwrapper in command-line download mode
aniwrapper -cqd
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
2021-12-30 11:57:16 -08:00
- [click here ](https://imgur.com/nLjqLCL.gif ) for an example showing streaming a new anime
- [click here ](https://imgur.com/nI455zI.gif ) for an example showing streaming a previously watched anime
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
### 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
2021-12-31 17:03:38 -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
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:
- 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-08 01:49:05 -08:00
## ani-cli Script
2021-11-02 15:18:23 -07:00
# watch anime
ani-cli < query >
# download anime
ani-cli -d < download_directory >
# resume watching anime
ani-cli -H
2021-06-09 05:25:23 -07:00
2021-11-02 15:18:23 -07:00
# list searched anime
ani-cli -l
2021-06-10 03:48:06 -07:00
2021-11-12 19:22:18 -08:00
# playlist mode
ani-cli -P
2021-11-08 00:37:08 -08:00
# add to playlist
ani-cli -a
2021-06-18 00:00:24 -07:00
2021-11-12 19:22:18 -08:00
# sync history across devices
ani-cli -s
2021-06-13 04:34:16 -07:00
2021-12-31 17:03:38 -08:00
# run ani-cli in command-line mode (rofi disabled)
ani-cli -c
2021-11-08 00:37:08 -08:00
Multiple episodes can be viewed/downloaded by giving the episode range like so
2021-06-13 04:34:16 -07:00
2021-11-08 00:37:08 -08:00
Choose episode [1-13]: 1 6
2021-06-09 05:25:23 -07:00
2021-11-08 00:37:08 -08:00
This would open/download episodes 1 2 3 4 5 6
2021-11-08 01:49:05 -08:00
# Screenshots
< div align = "center" >
Aniwrapper Main Menu
2021-12-31 17:03:38 -08:00
![aniwrapper frontpage ](https://imgur.com/bhea2u3.png )
2021-11-08 01:49:05 -08:00
Aniwrapper Streaming Menu
2021-12-15 17:42:16 -08:00
![aniwrapper streaming options ](https://imgur.com/jVJQERk.png )
2021-11-08 09:44:49 -08:00
More to come soon... maybe
2021-11-08 01:49:05 -08:00
< / div >