README.md

383 lines · 14489 bytes

  1# Curd
  2
  3A cli application to stream anime with [Anilist](https://anilist.co/) integration and Discord RPC written in golang.
  4Works on Windows and Linux
  5
  6## Join the discord server
  7
  8https://discord.gg/cNaNVEE3B6
  9
 10## Demo Video
 11Normal mode:
 12
 13
 14https://github.com/user-attachments/assets/376e7580-b1af-40ee-82c3-154191f75b79
 15
 16Rofi with Image preview
 17
 18
 19https://github.com/user-attachments/assets/cbf799bc-9fdd-4402-ab61-b4e31f1e264d
 20
 21
 22## Features
 23- Stream anime online
 24- Update anime in Anilist after completion
 25- Skip anime Intro and Outro
 26- Skip Filler and Recap episodes
 27- Discord RPC about the anime
 28- Rofi support
 29- Image preview in rofi
 30- Local anime history to continue from where you left off last time
 31- Save mpv speed for next episode
 32- Configurable through config file
 33
 34
 35## Installing and Setup
 36> **Note**: `Curd` requires `mpv`, `rofi`, and `ueberzugpp` for Rofi support and image preview. These are included in the installation instructions below for each distribution.
 37
 38### Linux
 39<details>
 40<summary>Arch Linux / Manjaro (AUR-based systems)</summary>
 41
 42Using Yay:
 43
 44```bash
 45yay -Sy curd
 46```
 47
 48or using Paru:
 49
 50```bash
 51paru -Sy curd
 52```
 53
 54Or, to manually clone and install:
 55
 56```bash
 57git clone https://aur.archlinux.org/curd.git
 58cd curd
 59makepkg -si
 60sudo pacman -S rofi ueberzugpp
 61```
 62</details>
 63
 64<details>
 65<summary>Debian / Ubuntu (and derivatives)</summary>
 66
 67```bash
 68sudo apt update
 69sudo apt install mpv curl rofi ueberzugpp
 70
 71# For x86_64 systems:
 72curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
 73
 74# For ARM64 systems:
 75curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
 76
 77chmod +x curd
 78sudo mv curd /usr/bin/
 79curd
 80```
 81</details>
 82
 83<details>
 84<summary>Fedora Installation</summary>
 85
 86```bash
 87sudo dnf update
 88sudo dnf install mpv curl rofi ueberzugpp
 89
 90# For x86_64 systems:
 91curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
 92
 93# For ARM64 systems:
 94curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
 95
 96chmod +x curd
 97sudo mv curd /usr/bin/
 98curd
 99```
100</details>
101
102<details>
103<summary>openSUSE Installation</summary>
104
105```bash
106sudo zypper refresh
107sudo zypper install mpv curl rofi ueberzugpp
108
109# For x86_64 systems:
110curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
111
112# For ARM64 systems:
113curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
114
115chmod +x curd
116sudo mv curd /usr/bin/
117curd
118```
119</details>
120
121<details>
122<summary>NixOS Installation</summary>
123
1241. Add curd as a flake input, for example:
125```nix
126{
127    inputs = {
128        nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
129        curd = {
130            url = "github:Wraient/curd";
131            inputs.nixpkgs.follows = "nixpkgs";
132        };
133    }
134}
135```
1362. Install the package, for example:
137```nix
138{inputs, pkgs, ...}: {
139  environment.systemPackages = [
140    inputs.curd.packages.${pkgs.system}.default
141  ];
142}
143```
144
145</details>
146
147<details>
148<summary>macOS Installation</summary>
149
150Install required dependencies
151```bash
152brew install mpv curl
153```
154
155Download the appropriate binary for your system:
156
157- For Apple Silicon (M1/M2) Macs:
158```bash
159curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-arm64
160```
161
162- For Intel Macs:
163```bash
164curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-x86_64
165```
166
167- For Universal Binary (works on both architectures):
168```bash
169curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-universal
170```
171
172Then complete the installation:
173
174```bash
175chmod +x curd
176sudo mv curd /usr/local/bin/
177curd
178```
179
180</details>
181
182<details>
183<summary>Windows Installation</summary>
184
185Option 1: Using the installer
186- Download and run the [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/curd-windows-installer.exe)
187
188Option 2: Standalone executable
189- Download [curd-windows-x86_64.exe](https://github.com/Wraient/curd/releases/latest/download/curd-windows-x86_64.exe)
190</details>
191
192<details>
193<summary>Generic Installation</summary>
194
195Choose the appropriate binary for your system:
196```bash
197# For Linux x86_64:
198curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
199
200# For Linux ARM64:
201curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
202
203# For macOS Universal:
204curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-universal
205
206chmod +x curd
207sudo mv curd /usr/bin/
208curd
209```
210</details>
211
212<details>
213<summary>Uninstallation</summary>
214
215```bash
216sudo rm /usr/bin/curd
217```
218
219For AUR-based distributions:
220
221```bash
222yay -R curd
223```
224</details>
225
226### [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/curd-windows-installer.exe)
227
228## Data Storage
229
230<details>
231<summary>Windows</summary>
232Stroage: (Token, Timestamps, debug.log, etc) 
233
234```bash
235C:\.local\share\curd
236```
237
238Config : 
239
240```bash
241C:\Users\USERNAME\AppData\Roaming\Curd
242```
243
244</details>
245
246<details>
247<summary>Linux/Unix</summary>
248Stroage: (Token, Timestamps, debug.log, etc)
249
250```bash
251$USER/.local/share/curd
252```
253
254Config : 
255
256```bash
257$USER/.config/curd
258```
259
260</details>
261
262## Usage
263
264Run `curd` with the following options:
265
266```bash
267curd [options]
268```
269
270### Arguments would always take precedence over configuration
271
272> **Note**:
273> - To use rofi you need rofi and ueberzug installed.
274> - Rofi .rasi files are at default `~/.local/share/curd/`
275> - You can edit them as you like.
276> - If there are no rasi files with specific names, they would be downloaded from this repo.
277
278
279### Options
280
281| Flag                      | Description                                                             | Default       |
282|---------------------------|-------------------------------------------------------------------------|---------------|
283| `-c`                      | Continue the last episode                                              | -             |
284| `-change-token`           | Change your authentication token                                       | -             |
285| `-dub`                    | Watch the dubbed version of the anime                                  | -             |
286| `-sub`                    | Watch the subbed version of the anime                                  | -             |
287| `-new`                    | Add a new anime to your list                                           | -             |
288| `-e`                      | Edit the configuration file                                            | -             |
289| `-skip-op`                | Automatically skip the opening section of each episode                 | `true`        |
290| `-skip-ed`                | Automatically skip the ending section of each episode                  | `true`        |
291| `-skip-filler`            | Automatically skip filler episodes                                     | `true`        |
292| `-skip-recap`             | Automatically skip recap sections                                      | `true`        |
293| `-discord-presence`       | Enable or disable Discord presence                                     | `true`        |
294| `-image-preview`          | Show an image preview of the anime                                     | -             |
295| `-no-image-preview`       | Disable image preview                                                  | -             |
296| `-next-episode-prompt`    | Prompt for the next episode after completing one                       | -             |
297| `-rofi`                   | Open anime selection in the rofi interface                             | -             |
298| `-no-rofi`                | Disable rofi interface                                                 | -             |
299| `-percentage-to-mark-complete` | Set the percentage watched to mark an episode as complete       | `85`          |
300| `-player`                 | Specify the player to use for playback                                 | `"mpv"`       |
301| `-save-mpv-speed`         | Save the current MPV speed setting for future sessions                 | `true`        |
302| `-score-on-completion`    | Prompt to score the episode on completion                              | `true`        |
303| `-storage-path`           | Path to the storage directory                                          | `"$HOME/.local/share/curd"` |
304| `-subs-lang`              | Set the language for subtitles                                         | `"english"`   |
305| `-u`                      | Update the script                                                      | -             |
306| `-v`                      | Show curd version                                                      | -             |
307
308### Examples
309
310- **Continue the Last Episode**:
311  ```bash
312  curd -c
313  ```
314
315- **Add a New Anime**:
316  ```bash
317  curd -percentage-to-mark-complete=90
318  ```
319
320- **Play with Rofi and Image Preview**:
321  ```bash
322  curd -rofi -image-preview
323  ```
324
325## Configuration
326
327All configurations are stored in a file you can edit with the `-e` option.
328
329```bash
330curd -e
331```
332
333Script is made in a way that you use it for one session of watching.
334
335You can quit it anytime and the resume time would be saved in the history file
336
337more settings can be found at config file.
338config file is located at ```~/.config/curd/curd.conf```
339
340| **Option**               | **Type**   | **Valid Values**                           | **Description**                                                                                   |
341|---------------------------|------------|-------------------------------------------|---------------------------------------------------------------------------------------------------|
342| `DiscordPresence`         | Boolean    | `true`, `false`                           | Enables or disables Discord Rich Presence integration.                                            |
343| `AnimeNameLanguage`       | Enum       | `english`, `romaji`                       | Sets the preferred language for anime names.                                                      |
344| `MpvArgs`                 | List       | all mpv args eg ["--fullscreen=yes", "--mute=yes"]     | Add args to mpv player                                                               | 
345| `AddMissingOptions`       | Boolean    | `true`, `false`                           | Automatically adds missing configuration options with default values to the config file.          |
346| `AlternateScreen`         | Boolean    | `true`, `false`                           | Toggles the use of an alternate screen buffer for cleaner UI.                                     |
347| `RofiSelection`           | Boolean    | `true`, `false`                           | Enables or disables anime selection via Rofi.                                                     |
348| `PercentageToMarkComplete`| Integer    | `0` to `100`                              | Sets the percentage of an episode watched to consider it as completed.                            |
349| `StoragePath`             | String     | Any valid path (Environment variables accepted)  | Specifies the directory where Curd stores its data.                                        |
350| `SubOrDub`                | Enum       | `sub`, `dub`                              | Sets the preferred format for anime audio.                                                        |
351| `NextEpisodePrompt`       | Boolean    | `true`, `false`                           | Prompts the user before automatically playing the next episode.                                   |
352| `SubsLanguage`            | String     | `english` (redundant rn)                  | Sets the preferred subtitle language.                                                             |
353| `ScoreOnCompletion`       | Boolean    | `true`, `false`                           | Automatically prompts the user to rate the anime upon completion.                                 |
354| `SkipOp`                  | Boolean    | `true`, `false`                           | Automatically skips the opening of episodes when supported.                                       |
355| `SkipEd`                  | Boolean    | `true`, `false`                           | Automatically skips the ending of episodes when supported.                                        |
356| `SkipRecap`               | Boolean    | `true`, `false`                           | Skips recap sections in episodes when supported.                                                  |
357| `ImagePreview`            | Boolean    | `true`, `false`                           | Enables or disables image previews during anime selection (only for rofi).                        |
358| `Player`                  | String     | `mpv` (redundant rn)                      | Specifies the media player used for streaming or playing anime.                                   |
359| `SaveMpvSpeed`            | Boolean    | `true`, `false`                           | Retains the playback speed set in MPV for next episode.                                           |
360| `SkipFiller`              | Boolean    | `true`, `false`                           | Skips filler episodes when supported.                                                             |
361
362## Todo (fix)
363- Config: Nextepisodeprompt, Cli Mode, Problem: Quitting with quit button while ep is still playing doesnt update progress, even if past Mark Complete Threshold (Regression)
364- Use Powershell for windows token input instead of notepad or cmd
365- Add Rewatching list to "Show All" Option
366- Last episode doesnt prompt for anime score (Regression)
367- Find a way to get "Watching" instead of "Playing" Activity type in discord rpc (Implemented in [Dantotsu](https://github.com/aayush2622/Dartotsu) and [Premid](https://github.com/PreMiD/PreMiD))
368- Add a better way to do commands in windows (Convinience for users)
369
370## Dependencies
371- mpv - Video player (vlc support might be added later)
372- rofi - Selection menu
373- ueberzug - Display images in rofi
374    
375## API Used
376- [Anilist API](https://anilist.gitbook.io/anilist-apiv2-docs) - Update user data and download user data
377- [AniSkip API](https://api.aniskip.com/api-docs) - Get anime intro and outro timings
378- [AllAnime Content](https://allanime.to/) - Fetch anime url
379- [Jikan](https://jikan.moe/) - Get filler episode number
380
381## Credits
382- [ani-cli](https://github.com/pystardust/ani-cli) - Code for fetching anime url
383- [jerry](https://github.com/justchokingaround/jerry) - For the inspiration