kaizoku-core 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/lib/config.d.ts +0 -4
- package/dist/lib/config.js +0 -3
- package/dist/providers/anime/allmanga.d.ts +6 -0
- package/dist/providers/anime/allmanga.js +545 -0
- package/dist/providers/anime/animepahe.js +1 -0
- package/dist/providers/anime/animeunity.js +1 -0
- package/dist/providers/anime/anineko.d.ts +6 -0
- package/dist/providers/anime/anineko.js +307 -0
- package/dist/providers/anime/anizone.js +16 -2
- package/dist/providers/anime/gojo.js +0 -1
- package/dist/providers/meta/anilist/anilist.js +39 -58
- package/dist/tests/test-helper.d.ts +1 -0
- package/dist/tests/test-helper.js +20 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/utils/mapping.d.ts +10 -0
- package/dist/utils/mapping.js +113 -0
- package/package.json +1 -1
- package/vitest.config.ts +0 -7
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @kaizoku
|
|
1
|
+
# @kaizoku-core
|
|
2
2
|
|
|
3
3
|
The core TypeScript engine powering [kaizoku.site](https://kaizoku.site). It contains modular, tree-shakeable scrapers for popular anime providers, video extractors, AniList integration, and metadata mapping.
|
|
4
4
|
|
|
@@ -10,23 +10,42 @@ The core TypeScript engine powering [kaizoku.site](https://kaizoku.site). It con
|
|
|
10
10
|
- **AniSkip Skip-Times**: Automatic integration with AniSkip API to fetch and inject intro/outro skip times into video streams.
|
|
11
11
|
- **Auto Proxying**: Built-in Anikuro proxy.
|
|
12
12
|
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Providers
|
|
16
|
+
|
|
17
|
+
| Provider | Status | Notes |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| **AniKoto** | ✅ Active | Large library, consistent,recommended |
|
|
20
|
+
| **AnimePahe** | ❌ Not Working | Recently switched from DDoS-Guard to Cloudflare JS Challenge — may need updates |
|
|
21
|
+
| **AniNeko** | ✅ Active | Solid source for a wide range of titles, dub + sub |
|
|
22
|
+
| **AllManga** | ✅ Active | Great coverage, sub + dub |
|
|
23
|
+
| **AnimeGG** | ✅ Active | works ,solid source ,dub+sub |
|
|
24
|
+
| **AniZone** | ✅ Active | Solid Source in my opinion ,audio(dub or sub ) is embed in the m3u8 file |
|
|
25
|
+
| **AniDB** | ❌ Not working | Language-aware, AniDB ID backed, currently working on a fix |
|
|
26
|
+
|**AnimeOnsen**|✅ Active | solid source ,mostly uses dash instead of m3u8 |
|
|
27
|
+
|**AnimeUnity**|✅ Active | solid source ,but mostly has italian based hard sub or mostly dubed in italian,mostly focus on italian marker|
|
|
28
|
+
|**Gojo**|✅ Active| multiprovider ,also known as animetsu , also scrapes other websites so multiple servers and pretty solid|
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
13
32
|
## Installation
|
|
14
33
|
|
|
15
34
|
```bash
|
|
16
|
-
npm install
|
|
35
|
+
npm install kaizoku-core
|
|
17
36
|
# or
|
|
18
|
-
pnpm add
|
|
37
|
+
pnpm add kaizoku-core
|
|
19
38
|
# or
|
|
20
|
-
yarn add
|
|
39
|
+
yarn add kaizoku-core
|
|
21
40
|
```
|
|
22
41
|
|
|
23
42
|
## Quick Start
|
|
24
43
|
|
|
25
44
|
### 1. Configuration
|
|
26
|
-
Set up global settings such as custom
|
|
45
|
+
Set up global settings such as custom proxy options: not a must
|
|
27
46
|
|
|
28
47
|
```typescript
|
|
29
|
-
import { configure } from '
|
|
48
|
+
import { configure } from 'kaizoku-core';
|
|
30
49
|
|
|
31
50
|
configure({
|
|
32
51
|
proxy: {
|
|
@@ -40,7 +59,7 @@ configure({
|
|
|
40
59
|
Get trending anime, popular items this season, or details:
|
|
41
60
|
|
|
42
61
|
```typescript
|
|
43
|
-
import { anilist } from '
|
|
62
|
+
import { anilist } from 'kaizoku-core';
|
|
44
63
|
|
|
45
64
|
// Get trending anime (paginated)
|
|
46
65
|
const trending = await anilist.getTrending(1, 10);
|
|
@@ -53,21 +72,23 @@ const details = await anilist.getAnimeDetail(166240);
|
|
|
53
72
|
Map an AniList ID directly to a provider and retrieve fully enriched episode data:
|
|
54
73
|
|
|
55
74
|
```typescript
|
|
56
|
-
import { anilist } from '
|
|
75
|
+
import { anilist } from 'kaizoku-core';
|
|
57
76
|
|
|
58
77
|
// Map AniList ID to 'anizone' and get AniZip enriched episodes
|
|
59
|
-
const episodes = await anilist.fetchEpisodesByProvider('166240', '
|
|
78
|
+
const episodes = await anilist.fetchEpisodesByProvider('166240', 'anikoto');
|
|
60
79
|
console.log(episodes[0]);
|
|
61
80
|
/*
|
|
62
81
|
{
|
|
63
|
-
id: "..."
|
|
82
|
+
id: "...",// the id of the episode used in fetchsources or fetchepisodesource functions for the provider
|
|
64
83
|
number: 1,
|
|
65
84
|
title: "...",
|
|
66
|
-
image: "...",
|
|
85
|
+
image: "...",
|
|
67
86
|
airDate: "...",
|
|
68
87
|
duration: 1500, // Enriched in seconds
|
|
69
88
|
description: "...",
|
|
70
89
|
providerName: "anizone"
|
|
90
|
+
hasdub:"",
|
|
91
|
+
hassub:"",
|
|
71
92
|
}
|
|
72
93
|
*/
|
|
73
94
|
```
|
|
@@ -76,12 +97,12 @@ console.log(episodes[0]);
|
|
|
76
97
|
Retrieve video stream URLs for a provider's episode. The response is automatically normalized to a unified `VideoStream` interface:
|
|
77
98
|
|
|
78
99
|
```typescript
|
|
79
|
-
import {
|
|
100
|
+
import { animekoto } from 'kaizoku-core'; // or from index/exports
|
|
80
101
|
|
|
81
102
|
// Fetch sources and apply AniSkip skip times
|
|
82
103
|
const malId = 55701;
|
|
83
104
|
const episodeNumber = 1;
|
|
84
|
-
const stream = await
|
|
105
|
+
const stream = await animekoto.fetchSources('episode-id', 'sub', 'vidstream-2');
|
|
85
106
|
|
|
86
107
|
// If you want AniSkip boundary ranges, they will be attached as:
|
|
87
108
|
// stream.intro -> { start: 2633, end: 2723 }
|
package/dist/index.d.ts
CHANGED
|
@@ -14,5 +14,6 @@ export * as animeunity from './providers/anime/animeunity.js';
|
|
|
14
14
|
export * as gojo from './providers/anime/gojo.js';
|
|
15
15
|
export * as animegg from './providers/anime/animegg.js';
|
|
16
16
|
export * as anidb from './providers/anime/anidb.js';
|
|
17
|
-
export * as animesaturn from './providers/anime/animesaturn.js';
|
|
18
17
|
export * as animepahe from './providers/anime/animepahe.js';
|
|
18
|
+
export * as allmanga from './providers/anime/allmanga.js';
|
|
19
|
+
export * as anineko from './providers/anime/anineko.js';
|
package/dist/index.js
CHANGED
|
@@ -14,5 +14,6 @@ export * as animeunity from './providers/anime/animeunity.js';
|
|
|
14
14
|
export * as gojo from './providers/anime/gojo.js';
|
|
15
15
|
export * as animegg from './providers/anime/animegg.js';
|
|
16
16
|
export * as anidb from './providers/anime/anidb.js';
|
|
17
|
-
export * as animesaturn from './providers/anime/animesaturn.js';
|
|
18
17
|
export * as animepahe from './providers/anime/animepahe.js';
|
|
18
|
+
export * as allmanga from './providers/anime/allmanga.js';
|
|
19
|
+
export * as anineko from './providers/anime/anineko.js';
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export interface ProxyConfig {
|
|
2
2
|
enabled?: boolean;
|
|
3
|
-
/** Custom proxy URL for the package to route standard requests through */
|
|
4
|
-
customUrl?: string;
|
|
5
3
|
/** Whether to append the hardcoded anikuro. proxies to the video sources */
|
|
6
4
|
generateSourceProxies?: boolean;
|
|
7
5
|
}
|
|
8
6
|
export interface ConfigOptions {
|
|
9
7
|
/** Proxy Configuration */
|
|
10
8
|
proxy?: ProxyConfig;
|
|
11
|
-
/** Optional custom AniList URL */
|
|
12
|
-
anilistProxyUrl?: string;
|
|
13
9
|
}
|
|
14
10
|
declare class KaizokuConfig {
|
|
15
11
|
proxy: ProxyConfig;
|
package/dist/lib/config.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnimeResult, AnimeInfo, VideoStream } from '../../types/types.js';
|
|
2
|
+
export declare function search(query: string, mode?: string): Promise<{
|
|
3
|
+
results: AnimeResult[];
|
|
4
|
+
}>;
|
|
5
|
+
export declare function fetchAnimeInfo(anilistId: string): Promise<AnimeInfo>;
|
|
6
|
+
export declare function fetchSources(episodeId: string, subOrDub?: 'sub' | 'dub'): Promise<VideoStream>;
|