README.md

400 lines · 15477 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, Linux, macOS, and Android via Termux
  5
  6## Join the discord server
  7
  8https://discord.gg/rrpBfu2gHq
  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### Android / Termux
 39
 40```bash
 41pkg install curl termux-api
 42curl -fsSL https://raw.githubusercontent.com/Wraient/curd/main/Build/install-termux.sh | bash
 43curd --android-setup
 44```
 45
 46Android mode keeps the terminal UI inside Termux, writes config to `~/.config/curd/android.conf`, and supports two playback modes:
 47- `ipc`: full automation when the configured Android player exposes MPV-compatible control
 48- `intent`: basic fallback launch mode with no reliable progress/control channel
 49
 50`mpvEx` is built on libmpv and does load its own `mpv.conf`, but `curd` cannot rely on MPV socket IPC with `mpvEx` on stock Android:
 51- `VIEW` intent extras do not appear to expose arbitrary MPV CLI options.
 52- `mpvEx` copies `mpv.conf` into its own app sandbox, not Termux's `~/.config/mpv/mpv.conf`.
 53- Unix socket paths inside Termux are not writable by another app, and shared storage is not a usable place for MPV Unix sockets.
 54
 55So `curd` currently uses `mpvEx` in `intent` mode unless `mpvEx` adds an exported control bridge that Termux can reach.
 56
 57### Linux
 58<details>
 59<summary>Arch Linux / Manjaro (AUR-based systems)</summary>
 60
 61Using Yay:
 62
 63```bash
 64yay -Sy curd
 65```
 66
 67or using Paru:
 68
 69```bash
 70paru -Sy curd
 71```
 72
 73Or, to manually clone and install:
 74
 75```bash
 76git clone https://aur.archlinux.org/curd.git
 77cd curd
 78makepkg -si
 79sudo pacman -S rofi ueberzugpp
 80```
 81</details>
 82
 83<details>
 84<summary>Debian / Ubuntu (and derivatives)</summary>
 85
 86```bash
 87sudo apt update
 88sudo apt 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>Fedora Installation</summary>
104
105```bash
106sudo dnf update
107sudo dnf 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>openSUSE Installation</summary>
123
124```bash
125sudo zypper refresh
126sudo zypper install mpv curl rofi ueberzugpp
127
128# For x86_64 systems:
129curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
130
131# For ARM64 systems:
132curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
133
134chmod +x curd
135sudo mv curd /usr/bin/
136curd
137```
138</details>
139
140<details>
141<summary>NixOS Installation</summary>
142
1431. Add curd as a flake input, for example:
144```nix
145{
146    inputs = {
147        nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
148        curd = {
149            url = "github:Wraient/curd";
150            inputs.nixpkgs.follows = "nixpkgs";
151        };
152    }
153}
154```
1552. Install the package, for example:
156```nix
157{inputs, pkgs, ...}: {
158  environment.systemPackages = [
159    inputs.curd.packages.${pkgs.system}.default
160  ];
161}
162```
163
164</details>
165
166<details>
167<summary>macOS Installation</summary>
168
169Install required dependencies
170```bash
171brew install mpv curl
172```
173
174Download the appropriate binary for your system:
175
176- For Apple Silicon (M1/M2) Macs:
177```bash
178curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-arm64
179```
180
181- For Intel Macs:
182```bash
183curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-x86_64
184```
185
186- For Universal Binary (works on both architectures):
187```bash
188curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-universal
189```
190
191Then complete the installation:
192
193```bash
194chmod +x curd
195sudo mv curd /usr/local/bin/
196curd
197```
198
199</details>
200
201<details>
202<summary>Windows Installation</summary>
203
204Option 1: Using the installer
205- Download and run the [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/curd-windows-installer.exe)
206
207Option 2: Standalone executable
208- Download [curd-windows-x86_64.exe](https://github.com/Wraient/curd/releases/latest/download/curd-windows-x86_64.exe)
209</details>
210
211<details>
212<summary>Generic Installation</summary>
213
214Choose the appropriate binary for your system:
215```bash
216# For Linux x86_64:
217curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
218
219# For Linux ARM64:
220curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
221
222# For macOS Universal:
223curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-universal
224
225chmod +x curd
226sudo mv curd /usr/bin/
227curd
228```
229</details>
230
231<details>
232<summary>Uninstallation</summary>
233
234```bash
235sudo rm /usr/bin/curd
236```
237
238For AUR-based distributions:
239
240```bash
241yay -R curd
242```
243</details>
244
245### [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/curd-windows-installer.exe)
246
247## Data Storage
248
249<details>
250<summary>Windows</summary>
251Stroage: (Token, Timestamps, debug.log, etc) 
252
253```bash
254C:\.local\share\curd
255```
256
257Config : 
258
259```bash
260C:\Users\USERNAME\AppData\Roaming\Curd
261```
262
263</details>
264
265<details>
266<summary>Linux/Unix</summary>
267Stroage: (Token, Timestamps, debug.log, etc)
268
269```bash
270$USER/.local/share/curd
271```
272
273Config : 
274
275```bash
276$USER/.config/curd
277```
278
279</details>
280
281## Usage
282
283Run `curd` with the following options:
284
285```bash
286curd [options]
287```
288
289### Arguments would always take precedence over configuration
290
291> **Note**:
292> - To use rofi you need rofi and ueberzug installed.
293> - Rofi .rasi files are at default `~/.local/share/curd/`
294> - You can edit them as you like.
295> - If there are no rasi files with specific names, they would be downloaded from this repo.
296
297
298### Options
299
300| Flag                      | Description                                                             | Default       |
301|---------------------------|-------------------------------------------------------------------------|---------------|
302| `-c`                      | Continue the last episode                                              | -             |
303| `-change-token`           | Change your authentication token                                       | -             |
304| `-dub`                    | Watch the dubbed version of the anime                                  | -             |
305| `-sub`                    | Watch the subbed version of the anime                                  | -             |
306| `-new`                    | Add a new anime to your list                                           | -             |
307| `-e`                      | Edit the configuration file                                            | -             |
308| `-skip-op`                | Automatically skip the opening section of each episode                 | `true`        |
309| `-skip-ed`                | Automatically skip the ending section of each episode                  | `true`        |
310| `-skip-filler`            | Automatically skip filler episodes                                     | `true`        |
311| `-skip-recap`             | Automatically skip recap sections                                      | `true`        |
312| `-discord-presence`       | Enable or disable Discord presence                                     | `true`        |
313| `-image-preview`          | Show an image preview of the anime                                     | -             |
314| `-no-image-preview`       | Disable image preview                                                  | -             |
315| `-next-episode-prompt`    | Prompt for the next episode after completing one                       | -             |
316| `-rofi`                   | Open anime selection in the rofi interface                             | -             |
317| `-no-rofi`                | Disable rofi interface                                                 | -             |
318| `-percentage-to-mark-complete` | Set the percentage watched to mark an episode as complete       | `85`          |
319| `-player`                 | Specify the player to use for playback                                 | `"mpv"`       |
320| `-save-mpv-speed`         | Save the current MPV speed setting for future sessions                 | `true`        |
321| `-score-on-completion`    | Prompt to score the episode on completion                              | `true`        |
322| `-storage-path`           | Path to the storage directory                                          | `"$HOME/.local/share/curd"` |
323| `-subs-lang`              | Set the language for subtitles                                         | `"english"`   |
324| `-u`                      | Update the script                                                      | -             |
325| `-v`                      | Show curd version                                                      | -             |
326
327### Examples
328
329- **Continue the Last Episode**:
330  ```bash
331  curd -c
332  ```
333
334- **Add a New Anime**:
335  ```bash
336  curd -percentage-to-mark-complete=90
337  ```
338
339- **Play with Rofi and Image Preview**:
340  ```bash
341  curd -rofi -image-preview
342  ```
343
344## Configuration
345
346All configurations are stored in a file you can edit with the `-e` option.
347
348```bash
349curd -e
350```
351
352Script is made in a way that you use it for one session of watching.
353
354You can quit it anytime and the resume time would be saved in the history file
355
356more settings can be found at config file.
357config file is located at ```~/.config/curd/curd.conf```
358
359| **Option**               | **Type**   | **Valid Values**                           | **Description**                                                                                   |
360|---------------------------|------------|-------------------------------------------|---------------------------------------------------------------------------------------------------|
361| `DiscordPresence`         | Boolean    | `true`, `false`                           | Enables or disables Discord Rich Presence integration.                                            |
362| `AnimeNameLanguage`       | Enum       | `english`, `romaji`                       | Sets the preferred language for anime names.                                                      |
363| `MpvArgs`                 | List       | all mpv args eg ["--fullscreen=yes", "--mute=yes"]     | Add args to mpv player                                                               | 
364| `AddMissingOptions`       | Boolean    | `true`, `false`                           | Automatically adds missing configuration options with default values to the config file.          |
365| `AlternateScreen`         | Boolean    | `true`, `false`                           | Toggles the use of an alternate screen buffer for cleaner UI.                                     |
366| `RofiSelection`           | Boolean    | `true`, `false`                           | Enables or disables anime selection via Rofi.                                                     |
367| `PercentageToMarkComplete`| Integer    | `0` to `100`                              | Sets the percentage of an episode watched to consider it as completed.                            |
368| `StoragePath`             | String     | Any valid path (Environment variables accepted)  | Specifies the directory where Curd stores its data.                                        |
369| `SubOrDub`                | Enum       | `sub`, `dub`                              | Sets the preferred format for anime audio.                                                        |
370| `NextEpisodePrompt`       | Boolean    | `true`, `false`                           | Prompts the user before automatically playing the next episode.                                   |
371| `SubsLanguage`            | String     | `english` (redundant rn)                  | Sets the preferred subtitle language.                                                             |
372| `ScoreOnCompletion`       | Boolean    | `true`, `false`                           | Automatically prompts the user to rate the anime upon completion.                                 |
373| `SkipOp`                  | Boolean    | `true`, `false`                           | Automatically skips the opening of episodes when supported.                                       |
374| `SkipEd`                  | Boolean    | `true`, `false`                           | Automatically skips the ending of episodes when supported.                                        |
375| `SkipRecap`               | Boolean    | `true`, `false`                           | Skips recap sections in episodes when supported.                                                  |
376| `ImagePreview`            | Boolean    | `true`, `false`                           | Enables or disables image previews during anime selection (only for rofi).                        |
377| `Player`                  | String     | any mpv-compatible binary (e.g. `mpv`, `iina`) | Player binary used for playback. If not found, Curd falls back to `mpv`.                          |
378| `SaveMpvSpeed`            | Boolean    | `true`, `false`                           | Retains the playback speed set in MPV for next episode.                                           |
379| `SkipFiller`              | Boolean    | `true`, `false`                           | Skips filler episodes when supported.                                                             |
380| `MenuOrder`               | String     | Comma-separated list                      | Controls which menu items appear and their order. Available options: `CURRENT`, `ALL`, `UNTRACKED`, `UPDATE`, `CONTINUE_LAST`, `PLANNING`, `COMPLETED`, `PAUSED`, `DROPPED`, `REWATCHING`. Only listed items will be shown. Default: `CURRENT,ALL,UNTRACKED,UPDATE,CONTINUE_LAST` |
381
382## Todo (fix)
383- Use Powershell for windows token input instead of notepad or cmd
384- Add a better way to do commands in windows (Convinience for users)
385
386## Dependencies
387- mpv - Video player (required fallback)
388- iina - Optional mpv-based player on macOS
389- rofi - Selection menu
390- ueberzug - Display images in rofi
391    
392## API Used
393- [Anilist API](https://anilist.gitbook.io/anilist-apiv2-docs) - Update user data and download user data
394- [AniSkip API](https://api.aniskip.com/api-docs) - Get anime intro and outro timings
395- [AllAnime Content](https://allanime.to/) - Fetch anime url
396- [Jikan](https://jikan.moe/) - Get filler episode number
397
398## Credits
399- [ani-cli](https://github.com/pystardust/ani-cli) - Code for fetching anime url
400- [jerry](https://github.com/justchokingaround/jerry) - For the inspiration