README.md

269 lines · 11253 bytes

  1
  2# Curd
  3
  4A cli application to stream anime with [Anilist](https://anilist.co/) integration and Discord RPC written in golang.
  5Works on Windows and Linux
  6
  7## Join the discord server
  8
  9https://discord.gg/cNaNVEE3B6
 10
 11## Demo Video
 12Normal mode:
 13
 14
 15https://github.com/user-attachments/assets/376e7580-b1af-40ee-82c3-154191f75b79
 16
 17Rofi with Image preview
 18
 19
 20https://github.com/user-attachments/assets/cbf799bc-9fdd-4402-ab61-b4e31f1e264d
 21
 22
 23## Features
 24- Stream anime online
 25- Update anime in Anilist after completion
 26- Skip anime Intro and Outro
 27- Skip Filler and Recap episodes
 28- Discord RPC about the anime
 29- Rofi support
 30- Image preview in rofi
 31- Local anime history to continue from where you left off last time
 32- Save mpv speed for next episode
 33- Configurable through config file
 34
 35
 36## Installing and Setup
 37> **Note**: `Curd` requires `mpv`, `rofi`, and `ueberzugpp` for Rofi support and image preview. These are included in the installation instructions below for each distribution.
 38
 39### Linux
 40<details>
 41<summary>Arch Linux / Manjaro (AUR-based systems)</summary>
 42
 43Using Yay:
 44
 45```bash
 46yay -Sy curd
 47```
 48
 49or using Paru:
 50
 51```bash
 52paru -Sy curd
 53```
 54
 55Or, to manually clone and install:
 56
 57```bash
 58git clone https://aur.archlinux.org/curd.git
 59cd curd
 60makepkg -si
 61sudo pacman -S rofi ueberzugpp
 62```
 63</details>
 64
 65<details>
 66<summary>Debian / Ubuntu (and derivatives)</summary>
 67
 68```bash
 69sudo apt update
 70sudo apt install mpv curl rofi ueberzugpp
 71curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd
 72chmod +x curd
 73sudo mv curd /usr/bin/
 74curd
 75```
 76</details>
 77
 78<details>
 79<summary>Fedora Installation</summary>
 80
 81```bash
 82sudo dnf update
 83sudo dnf install mpv curl rofi ueberzugpp
 84curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd
 85chmod +x curd
 86sudo mv curd /usr/bin/
 87curd
 88```
 89</details>
 90
 91<details>
 92<summary>openSUSE Installation</summary>
 93
 94```bash
 95sudo zypper refresh
 96sudo zypper install mpv curl rofi ueberzugpp
 97curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd
 98chmod +x curd
 99sudo mv curd /usr/bin/
100curd
101```
102</details>
103
104<details>
105<summary>NixOS Installation</summary>
106
1071. Add curd as a flake input, for example:
108```nix
109{
110    inputs = {
111        nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
112        curd = {
113            url = "github:Wraient/curd";
114            inputs.nixpkgs.follows = "nixpkgs";
115        };
116    }
117}
118```
1192. Install the package, for example:
120```nix
121{inputs, pkgs, ...}: {
122  environment.systemPackages = [
123    inputs.curd.packages.${pkgs.system}.default
124  ];
125}
126```
127
128</details>
129
130<details>
131<summary>Generic Installation</summary>
132
133```bash
134# Install mpv, curl, rofi, and ueberzugpp (required for image preview)
135curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd
136chmod +x curd
137sudo mv curd /usr/bin/
138curd
139```
140</details>
141
142<details>
143<summary>Uninstallation</summary>
144
145```bash
146sudo rm /usr/bin/curd
147```
148
149For AUR-based distributions:
150
151```bash
152yay -R curd
153```
154</details>
155
156### [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/CurdInstaller.exe)
157
158## Usage
159
160Run `curd` with the following options:
161
162```bash
163curd [options]
164```
165
166### Arugments would always take precendence over configuration
167
168> **Note**:
169> - To use rofi you need rofi and ueberzug installed.
170> - Rofi .rasi files are at default `~/.local/share/curd/`
171> - You can edit them as you like.
172> - If there are no rasi files with specific names, they would be downloaded from this repo.
173
174
175### Options
176
177| Flag                      | Description                                                             | Default       |
178|---------------------------|-------------------------------------------------------------------------|---------------|
179| `-c`                      | Continue the last episode                                              | -             |
180| `-change-token`           | Change your authentication token                                       | -             |
181| `-dub`                    | Watch the dubbed version of the anime                                  | -             |
182| `-sub`                    | Watch the subbed version of the anime                                  | -             |
183| `-new`                    | Add a new anime to your list                                           | -             |
184| `-e`                      | Edit the configuration file                                            | -             |
185| `-skip-op`                | Automatically skip the opening section of each episode                 | `true`        |
186| `-skip-ed`                | Automatically skip the ending section of each episode                  | `true`        |
187| `-skip-filler`            | Automatically skip filler episodes                                     | `true`        |
188| `-skip-recap`             | Automatically skip recap sections                                      | `true`        |
189| `-discord-presence`       | Enable or disable Discord presence                                     | `true`        |
190| `-image-preview`          | Show an image preview of the anime                                     | -             |
191| `-no-image-preview`       | Disable image preview                                                  | -             |
192| `-next-episode-prompt`    | Prompt for the next episode after completing one                       | -             |
193| `-rofi`                   | Open anime selection in the rofi interface                             | -             |
194| `-no-rofi`                | Disable rofi interface                                                 | -             |
195| `-percentage-to-mark-complete` | Set the percentage watched to mark an episode as complete       | `85`          |
196| `-player`                 | Specify the player to use for playback                                 | `"mpv"`       |
197| `-save-mpv-speed`         | Save the current MPV speed setting for future sessions                 | `true`        |
198| `-score-on-completion`    | Prompt to score the episode on completion                              | `true`        |
199| `-storage-path`           | Path to the storage directory                                          | `"$HOME/.local/share/curd"` |
200| `-subs-lang`              | Set the language for subtitles                                         | `"english"`   |
201| `-u`                      | Update the script                                                      | -             |
202
203### Examples
204
205- **Continue the Last Episode**:
206  ```bash
207  curd -c
208  ```
209
210- **Add a New Anime**:
211  ```bash
212  curd -percentage-to-mark-complete=90
213  ```
214
215- **Play with Rofi and Image Preview**:
216  ```bash
217  curd -rofi -image-preview
218  ```
219
220## Configuration
221
222All configurations are stored in a file you can edit with the `-e` option.
223
224```bash
225curd -e
226```
227
228Script is made in a way that you use it for one session of watching.
229
230You can quit it anytime and the resume time would be saved in the history file
231
232more settings can be found at config file.
233config file is located at ```~/.config/curd/curd.conf```
234
235| **Option**               | **Type**   | **Valid Values**                  | **Description**                                                                                   |
236|---------------------------|------------|----------------------------------|---------------------------------------------------------------------------------------------------|
237| `DiscordPresence`         | Boolean    | `true`, `false`                  | Enables or disables Discord Rich Presence integration.                                            |
238| `AnimeNameLanguage`       | Enum       | `english`, `romaji`              | Sets the preferred language for anime names.                                                      |
239| `AddMissingOptions`       | Boolean    | `true`, `false`                  | Automatically adds missing configuration options with default values to the config file.          |
240| `AlternateScreen`         | Boolean    | `true`, `false`                  | Toggles the use of an alternate screen buffer for cleaner UI.                                     |
241| `RofiSelection`           | Boolean    | `true`, `false`                  | Enables or disables anime selection via Rofi.                                                     |
242| `PercentageToMarkComplete`| Integer    | `0` to `100`                     | Sets the percentage of an episode watched to consider it as completed.                            |
243| `StoragePath`             | String     | Any valid path (Environment variables accepted)  | Specifies the directory where Curd stores its data.                               |
244| `SubOrDub`                | Enum       | `sub`, `dub`                     | Sets the preferred format for anime audio.                                                        |
245| `NextEpisodePrompt`       | Boolean    | `true`, `false`                  | Prompts the user before automatically playing the next episode.                                   |
246| `SubsLanguage`            | String     | `english` (redundant rn)         | Sets the preferred subtitle language.                                                             |
247| `ScoreOnCompletion`       | Boolean    | `true`, `false`                  | Automatically prompts the user to rate the anime upon completion.                                 |
248| `SkipOp`                  | Boolean    | `true`, `false`                  | Automatically skips the opening of episodes when supported.                                       |
249| `SkipEd`                  | Boolean    | `true`, `false`                  | Automatically skips the ending of episodes when supported.                                        |
250| `SkipRecap`               | Boolean    | `true`, `false`                  | Skips recap sections in episodes when supported.                                                  |
251| `ImagePreview`            | Boolean    | `true`, `false`                  | Enables or disables image previews during anime selection (only for rofi).                        |
252| `Player`                  | String     | `mpv` (redundant rn)             | Specifies the media player used for streaming or playing anime.                                   |
253| `SaveMpvSpeed`            | Boolean    | `true`, `false`                  | Retains the playback speed set in MPV for next episode.                                           |
254| `SkipFiller`              | Boolean    | `true`, `false`                  | Skips filler episodes when supported.                                                             |
255
256## Dependencies
257- mpv - Video player (vlc support might be added later)
258- rofi - Selection menu
259- ueberzug - Display images in rofi
260    
261## API Used
262- [Anilist API](https://anilist.gitbook.io/anilist-apiv2-docs) - Update user data and download user data
263- [AniSkip API](https://api.aniskip.com/api-docs) - Get anime intro and outro timings
264- [AllAnime Content](https://allanime.to/) - Fetch anime url
265- [Jikan](https://jikan.moe/) - Get filler episode number
266
267## Credits
268- [ani-cli](https://github.com/pystardust/ani-cli) - Code for fetching anime url
269- [jerry](https://github.com/justchokingaround/jerry) - For the inspiration