README.md
424 lines · 17952 bytes
1# Curd
2
3A cli application to stream anime with [Anilist](https://anilist.co/) integration and Discord RPC written in golang.
4Works on Linux, MacOS and Windows.
5
6## Join the discord server
7
8https://discord.gg/rrpBfu2gHq
9
10## Join the Matrix server
11
12https://matrix.to/#/#curd:matrix.org
13
14## Demo Video
15Normal mode:
16
17
18https://github.com/user-attachments/assets/376e7580-b1af-40ee-82c3-154191f75b79
19
20Rofi with Image preview
21
22
23https://github.com/user-attachments/assets/cbf799bc-9fdd-4402-ab61-b4e31f1e264d
24
25
26## Features
27- Multiple Content Providers (AllAnime and Animepahe) with ordered fallback and up to 1080p support
28- Built-in headless browser to bypass Cloudflare/DDoS-Guard protections
29- Stream anime online
30- Track anime locally, on AniList, or on MyAnimeList
31- Browser-based AniList and MyAnimeList login flows
32- Skip anime Intro and Outro
33- Skip Filler and Recap episodes
34- Discord RPC about the anime
35- Rofi support
36- Image preview in rofi
37- Local anime history to continue from where you left off last time
38- Save mpv speed for next episode
39- Configurable through config file
40
41
42## Installing and Setup
43> **Note**: `Curd` requires `mpv`, `rofi`, and `ueberzugpp` for Rofi support and image preview. These are included in the installation instructions below for each distribution.
44
45### Linux
46<details>
47<summary>Arch Linux / Manjaro (AUR-based systems)</summary>
48
49Using Yay:
50
51```bash
52yay -Sy curd
53```
54
55or using Paru:
56
57```bash
58paru -Sy curd
59```
60
61Or, to manually clone and install:
62
63```bash
64git clone https://aur.archlinux.org/curd.git
65cd curd
66makepkg -si
67sudo pacman -S rofi ueberzugpp
68```
69</details>
70
71<details>
72<summary>Debian / Ubuntu (and derivatives)</summary>
73
74```bash
75sudo apt update
76sudo apt install mpv curl rofi ueberzugpp
77
78# For x86_64 systems:
79curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
80
81# For ARM64 systems:
82curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
83
84chmod +x curd
85sudo mv curd /usr/bin/
86curd
87```
88</details>
89
90<details>
91<summary>Fedora Installation</summary>
92
93```bash
94sudo dnf update
95sudo dnf install mpv curl rofi ueberzugpp
96
97# For x86_64 systems:
98curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
99
100# For ARM64 systems:
101curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
102
103chmod +x curd
104sudo mv curd /usr/bin/
105curd
106```
107</details>
108
109<details>
110<summary>openSUSE Installation</summary>
111
112```bash
113sudo zypper refresh
114sudo zypper install mpv curl rofi ueberzugpp
115
116# For x86_64 systems:
117curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
118
119# For ARM64 systems:
120curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
121
122chmod +x curd
123sudo mv curd /usr/bin/
124curd
125```
126</details>
127
128<details>
129<summary>NixOS Installation</summary>
130
1311. Add curd as a flake input, for example:
132```nix
133{
134 inputs = {
135 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
136 curd = {
137 url = "github:Wraient/curd";
138 inputs.nixpkgs.follows = "nixpkgs";
139 };
140 }
141}
142```
1432. Install the package, for example:
144```nix
145{inputs, pkgs, ...}: {
146 environment.systemPackages = [
147 inputs.curd.packages.${pkgs.system}.default
148 ];
149}
150```
151
152</details>
153
154<details>
155<summary>Generic Installation</summary>
156
157Choose the appropriate binary for your system:
158```bash
159# For Linux x86_64:
160curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-x86_64
161
162# For Linux ARM64:
163curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-linux-arm64
164
165chmod +x curd
166sudo mv curd /usr/bin/
167curd
168```
169</details>
170
171<details>
172<summary>Uninstallation</summary>
173
174```bash
175sudo rm /usr/bin/curd
176```
177
178For AUR-based distributions:
179
180```bash
181yay -R curd
182```
183</details>
184
185### MacOS
186
187<details>
188<summary>MacOS Installation</summary>
189
190Install required dependencies
191```bash
192brew install mpv curl
193```
194
195Download the appropriate binary for your system:
196
197- For Apple Silicon (M1/M2) Macs:
198```bash
199curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-arm64
200```
201
202- For Intel Macs:
203```bash
204curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-x86_64
205```
206
207- For Universal Binary (works on both architectures):
208```bash
209curl -Lo curd https://github.com/Wraient/curd/releases/latest/download/curd-macos-universal
210```
211
212Then complete the installation:
213
214```bash
215chmod +x curd
216sudo mv curd /usr/local/bin/
217curd
218```
219
220</details>
221
222<details>
223<summary>Uninstallation</summary>
224
225```bash
226sudo rm /usr/local/bin/curd
227```
228
229</details>
230
231### Windows
232
233<details>
234<summary>Windows Installation</summary>
235
236Option 1: Using the installer
237- Download and run the [Windows Installer](https://github.com/Wraient/curd/releases/latest/download/curd-windows-installer.exe)
238
239Option 2: Standalone executable
240- Download [curd-windows-x86_64.exe](https://github.com/Wraient/curd/releases/latest/download/curd-windows-x86_64.exe)
241</details>
242
243## Data Storage
244
245<details>
246<summary>Windows</summary>
247Stroage: (Token, Timestamps, debug.log, etc)
248
249```bash
250C:\.local\share\curd
251```
252
253Config :
254
255```bash
256C:\Users\USERNAME\AppData\Roaming\Curd
257```
258
259</details>
260
261<details>
262<summary>Linux/Unix</summary>
263Stroage: (Token, Timestamps, debug.log, etc)
264
265```bash
266$USER/.local/share/curd
267```
268
269Config :
270
271```bash
272$USER/.config/curd
273```
274
275</details>
276
277## Usage
278
279Run `curd` with the following options:
280
281```bash
282curd [options]
283```
284
285### Arguments would always take precedence over configuration
286
287> **Note**:
288> - To use rofi you need rofi and ueberzug installed.
289> - Rofi .rasi files are at default `~/.local/share/curd/`
290> - You can edit them as you like.
291> - If there are no rasi files with specific names, they would be downloaded from this repo.
292
293
294### Options
295
296| Flag | Description | Default |
297|---------------------------|-------------------------------------------------------------------------|---------------|
298| `-c` | Continue the last episode | - |
299| `-change-token` | Change your authentication token | - |
300| `-dub` | Watch the dubbed version of the anime | - |
301| `-sub` | Watch the subbed version of the anime | - |
302| `-new` | Add a new anime to your list | - |
303| `-e` | Edit the configuration file | - |
304| `-skip-op` | Automatically skip the opening section of each episode | `true` |
305| `-skip-ed` | Automatically skip the ending section of each episode | `true` |
306| `-skip-filler` | Automatically skip filler episodes | `true` |
307| `-skip-recap` | Automatically skip recap sections | `true` |
308| `-discord-presence` | Enable or disable Discord presence | `true` |
309| `-image-preview` | Show an image preview of the anime | - |
310| `-no-image-preview` | Disable image preview | - |
311| `-next-episode-prompt` | Prompt for the next episode after completing one | - |
312| `-rofi` | Open anime selection in the rofi interface | - |
313| `-no-rofi` | Disable rofi interface | - |
314| `-percentage-to-mark-complete` | Set the percentage watched to mark an episode as complete | `85` |
315| `-player` | Specify the player to use for playback | `"mpv"` |
316| `-save-mpv-speed` | Save the current MPV speed setting for future sessions | `true` |
317| `-score-on-completion` | Prompt to score the episode on completion | `true` |
318| `-storage-path` | Path to the storage directory | `"$HOME/.local/share/curd"` |
319| `-subs-lang` | Set the language for subtitles | `"english"` |
320| `-u` | Update the script | - |
321| `-v` | Show curd version | - |
322
323### Examples
324
325- **Continue the Last Episode**:
326 ```bash
327 curd -c
328 ```
329
330- **Add a New Anime**:
331 ```bash
332 curd -percentage-to-mark-complete=90
333 ```
334
335- **Play with Rofi and Image Preview**:
336 ```bash
337 curd -rofi -image-preview
338 ```
339
340## Configuration
341
342All configurations are stored in a file you can edit with the `-e` option.
343
344```bash
345curd -e
346```
347
348Script is made in a way that you use it for one session of watching.
349
350You can quit it anytime and the resume time would be saved in the history file
351
352more settings can be found at config file.
353config file is located at ```~/.config/curd/curd.conf```
354
355On first start, curd asks which tracking mode you want to use:
356
357- local
358- anilist
359- myanimelist
360- anilist + myanimelist
361
362Local history stays enabled in all modes. `anilist` means local history + AniList sync, `myanimelist` means local history + MyAnimeList sync, and `anilist + myanimelist` updates both platforms. In dual-sync mode, curd compares the latest remote update time for each anime and pushes the newest status/progress/category back to the older tracker so both sides converge automatically. Legacy installs are migrated to `anilist` automatically. If you switch trackers later, curd exposes a **Change Tracker** menu entry and can either merge both lists, replace MyAnimeList with AniList, or replace AniList with MyAnimeList.
363
364MyAnimeList OAuth requires your own MAL application credentials. You can set them in the config file or with environment variables:
365
366```bash
367CURD_MAL_CLIENT_ID=your_client_id
368CURD_MAL_CLIENT_SECRET=your_client_secret
369```
370
371If the browser reaches the localhost callback page but curd does not continue automatically, rerun the command and paste the full callback URL when prompted. Curd now keeps the pending MyAnimeList PKCE state so the login can be completed manually.
372
373| **Option** | **Type** | **Valid Values** | **Description** |
374|---------------------------|------------|-------------------------------------------|---------------------------------------------------------------------------------------------------|
375| `DiscordPresence` | Boolean | `true`, `false` | Enables or disables Discord Rich Presence integration. |
376| `AnimeNameLanguage` | Enum | `english`, `romaji` | Sets the preferred language for anime names. |
377| `MpvArgs` | List | all mpv args eg ["--fullscreen=yes", "--mute=yes"] | Add args to mpv player |
378| `AddMissingOptions` | Boolean | `true`, `false` | Automatically adds missing configuration options with default values to the config file. |
379| `AlternateScreen` | Boolean | `true`, `false` | Toggles the use of an alternate screen buffer for cleaner UI. |
380| `RofiSelection` | Boolean | `true`, `false` | Enables or disables anime selection via Rofi. |
381| `PercentageToMarkComplete`| Integer | `0` to `100` | Sets the percentage of an episode watched to consider it as completed. |
382| `StoragePath` | String | Any valid path (Environment variables accepted) | Specifies the directory where Curd stores its data. |
383| `SubOrDub` | Enum | `sub`, `dub` | Sets the preferred format for anime audio. |
384| `NextEpisodePrompt` | Boolean | `true`, `false` | Prompts the user before automatically playing the next episode. |
385| `SubsLanguage` | String | `english` (redundant rn) | Sets the preferred subtitle language. |
386| `ScoreOnCompletion` | Boolean | `true`, `false` | Automatically prompts the user to rate the anime upon completion. |
387| `SkipOp` | Boolean | `true`, `false` | Automatically skips the opening of episodes when supported. |
388| `SkipEd` | Boolean | `true`, `false` | Automatically skips the ending of episodes when supported. |
389| `SkipRecap` | Boolean | `true`, `false` | Skips recap sections in episodes when supported. |
390| `ImagePreview` | Boolean | `true`, `false` | Enables or disables image previews during anime selection (only for rofi). |
391| `Player` | String | any mpv-compatible binary (e.g. `mpv`, `iina`) | Player binary used for playback. If not found, Curd falls back to `mpv`. |
392| `SaveMpvSpeed` | Boolean | `true`, `false` | Retains the playback speed set in MPV for next episode. |
393| `SkipFiller` | Boolean | `true`, `false` | Skips filler episodes when supported. |
394| `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`, `TRACKER`, `PROVIDER`. Only listed items will be shown. Default: `CURRENT,ALL,UNTRACKED,UPDATE,CONTINUE_LAST,TRACKER,PROVIDER` |
395| `Provider` | List | `["allanime"]`, `["animepahe"]`, `["allanime","animepahe"]`, `["allanime","no-animepahe"]` | Sets the ordered content-provider fallback list. Curd tries providers from left to right for the requested stream. If AllAnime has no search results or the requested episode stream is unavailable and Animepahe is not configured, Curd asks before enabling Animepahe and warns that DDoS-Guard verification may require a ~500 MB chromium download. Declining stores `no-animepahe` so Curd does not ask again. Legacy single values like `allanime` are migrated to list form. Default: `["allanime"]` |
396| `TrackingLocal` | Boolean | `true` | Legacy compatibility flag. Local playback history is always enabled. |
397| `TrackingRemote` | Enum | `none`, `anilist`, `myanimelist`, `anilist+myanimelist` | Selects which remote tracker curd syncs with. |
398| `TrackingConfigured` | Boolean | `true`, `false` | Internal flag used to remember that the startup tracking prompt has already been completed. |
399| `MyAnimeListClientID` | String | MAL OAuth client ID | Client ID used for MyAnimeList browser login. |
400| `MyAnimeListClientSecret` | String | MAL OAuth client secret | Optional secret used for MyAnimeList browser login and token refresh. |
401| `MyAnimeListImported` | Boolean | `true`, `false` | Tracks whether the one-time AniList-to-MyAnimeList import prompt has already been handled. |
402
403## Todo (fix)
404- Use Powershell for windows token input instead of notepad or cmd
405- Add a better way to do commands in windows (Convinience for users)
406
407## Dependencies
408- mpv - Video player (required fallback)
409- iina - Optional mpv-based player on macOS
410- rofi - Selection menu
411- ueberzug - Display images in rofi
412- chromium - Required for Animepahe (auto-downloaded by default, but Termux users must install manually via `pkg install chromium`)
413
414## API Used
415- [Anilist API](https://anilist.gitbook.io/anilist-apiv2-docs) - Update user data and download user data
416- [MyAnimeList API](https://myanimelist.net/apiconfig/references/api/v2) - MyAnimeList OAuth and tracking sync
417- [AniSkip API](https://api.aniskip.com/api-docs) - Get anime intro and outro timings
418- [AllAnime Content](https://allanime.to/) - Fetch anime url
419- [Animepahe Content](https://animepahe.pw/) - Alternative provider for 1080p streams
420- [Jikan](https://jikan.moe/) - Get filler episode number
421
422## Credits
423- [ani-cli](https://github.com/pystardust/ani-cli) - Code for fetching anime url
424- [jerry](https://github.com/justchokingaround/jerry) - For the inspiration