kaizoku-core 0.1.0
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/LICENSE +0 -0
- package/README.md +105 -0
- package/dist/extractors/kwik.d.ts +6 -0
- package/dist/extractors/kwik.js +33 -0
- package/dist/extractors/megaplay.d.ts +2 -0
- package/dist/extractors/megaplay.js +32 -0
- package/dist/extractors/streamwish.d.ts +4 -0
- package/dist/extractors/streamwish.js +86 -0
- package/dist/extractors/vidtube.d.ts +2 -0
- package/dist/extractors/vidtube.js +24 -0
- package/dist/extractors/vidwish.d.ts +2 -0
- package/dist/extractors/vidwish.js +32 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -0
- package/dist/lib/config.d.ts +22 -0
- package/dist/lib/config.js +21 -0
- package/dist/providers/anime/anidb.d.ts +6 -0
- package/dist/providers/anime/anidb.js +88 -0
- package/dist/providers/anime/anikoto.d.ts +41 -0
- package/dist/providers/anime/anikoto.js +259 -0
- package/dist/providers/anime/animegg.d.ts +6 -0
- package/dist/providers/anime/animegg.js +107 -0
- package/dist/providers/anime/animeonsen.d.ts +6 -0
- package/dist/providers/anime/animeonsen.js +95 -0
- package/dist/providers/anime/animepahe.d.ts +6 -0
- package/dist/providers/anime/animepahe.js +102 -0
- package/dist/providers/anime/animesaturn.d.ts +8 -0
- package/dist/providers/anime/animesaturn.js +160 -0
- package/dist/providers/anime/animeunity.d.ts +4 -0
- package/dist/providers/anime/animeunity.js +108 -0
- package/dist/providers/anime/anizone.d.ts +12 -0
- package/dist/providers/anime/anizone.js +146 -0
- package/dist/providers/anime/gojo.d.ts +6 -0
- package/dist/providers/anime/gojo.js +83 -0
- package/dist/providers/meta/anilist/anilist.d.ts +28 -0
- package/dist/providers/meta/anilist/anilist.js +263 -0
- package/dist/providers/meta/anilist/queries.d.ts +22 -0
- package/dist/providers/meta/anilist/queries.js +405 -0
- package/dist/providers/meta/anilist/types.d.ts +213 -0
- package/dist/providers/meta/anilist/types.js +21 -0
- package/dist/providers/meta/anilist.d.ts +15 -0
- package/dist/providers/meta/anilist.js +94 -0
- package/dist/types/types.d.ts +88 -0
- package/dist/types/types.js +4 -0
- package/dist/utils/http.d.ts +13 -0
- package/dist/utils/http.js +39 -0
- package/dist/utils/proxy.d.ts +9 -0
- package/dist/utils/proxy.js +43 -0
- package/dist/utils/shared.d.ts +15 -0
- package/dist/utils/shared.js +64 -0
- package/dist/utils/unpack.d.ts +9 -0
- package/dist/utils/unpack.js +59 -0
- package/package.json +34 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { getJson } from '../../../utils/http.js';
|
|
2
|
+
import { config } from '../../../lib/config.js';
|
|
3
|
+
import { TRENDING_QUERY, POPULAR_THIS_SEASON_QUERY, UPCOMING_QUERY, ALL_TIME_POPULAR_QUERY, ALL_TIME_FAVORITE_QUERY, TOP_RATED_QUERY, CURRENTLY_AIRING_QUERY, SEARCH_QUERY, MEDIA_DETAIL_QUERY, HERO_QUERY, GENRE_COLLECTION_QUERY, TAG_COLLECTION_QUERY, SETTINGS_ASSETS_QUERY, } from './queries.js';
|
|
4
|
+
import { getCurrentSeason, getNextSeason, } from './types.js';
|
|
5
|
+
// Import all providers statically for fallback and episode fetching
|
|
6
|
+
import * as anikoto from '../../anime/anikoto.js';
|
|
7
|
+
import * as anizone from '../../anime/anizone.js';
|
|
8
|
+
import * as animeonsen from '../../anime/animeonsen.js';
|
|
9
|
+
import * as animeunity from '../../anime/animeunity.js';
|
|
10
|
+
import * as gojo from '../../anime/gojo.js';
|
|
11
|
+
import * as animegg from '../../anime/animegg.js';
|
|
12
|
+
import * as anidb from '../../anime/anidb.js';
|
|
13
|
+
import * as animesaturn from '../../anime/animesaturn.js';
|
|
14
|
+
import * as animepahe from '../../anime/animepahe.js';
|
|
15
|
+
const PROVIDERS = {
|
|
16
|
+
anikoto,
|
|
17
|
+
anizone,
|
|
18
|
+
animeonsen,
|
|
19
|
+
animeunity,
|
|
20
|
+
gojo,
|
|
21
|
+
animegg,
|
|
22
|
+
anidb,
|
|
23
|
+
animesaturn,
|
|
24
|
+
animepahe,
|
|
25
|
+
};
|
|
26
|
+
const WORKER_SUPPORTED_PROVIDERS = ['anikoto', 'anizone', 'animepahe'];
|
|
27
|
+
async function anilistFetch(query, variables) {
|
|
28
|
+
const res = await fetch(config.anilistUrl, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
headers: {
|
|
31
|
+
"Content-Type": "application/json",
|
|
32
|
+
Accept: "application/json",
|
|
33
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
|
34
|
+
"Origin": "https://kaizoku.site",
|
|
35
|
+
"Referer": "https://kaizoku.site/"
|
|
36
|
+
},
|
|
37
|
+
body: JSON.stringify({ query, variables }),
|
|
38
|
+
});
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
const errorBody = await res.text().catch(() => "");
|
|
41
|
+
throw new Error(`AniList Error: ${res.status} - ${errorBody.slice(0, 500)}`);
|
|
42
|
+
}
|
|
43
|
+
const json = await res.json();
|
|
44
|
+
return json.data;
|
|
45
|
+
}
|
|
46
|
+
// ─── List Fetchers ──────────────────────────────────────────────
|
|
47
|
+
export const getTrending = async (page, perPage) => {
|
|
48
|
+
const data = await anilistFetch(TRENDING_QUERY, { page, perPage });
|
|
49
|
+
return data.Page;
|
|
50
|
+
};
|
|
51
|
+
export const getPopularThisSeason = async (page, perPage) => {
|
|
52
|
+
const season = getCurrentSeason();
|
|
53
|
+
const seasonYear = new Date().getFullYear();
|
|
54
|
+
const data = await anilistFetch(POPULAR_THIS_SEASON_QUERY, { page, perPage, season, seasonYear });
|
|
55
|
+
return data.Page;
|
|
56
|
+
};
|
|
57
|
+
export const getUpcoming = async (page, perPage) => {
|
|
58
|
+
const { season, year } = getNextSeason();
|
|
59
|
+
const data = await anilistFetch(UPCOMING_QUERY, { page, perPage, season, seasonYear: year });
|
|
60
|
+
return data.Page;
|
|
61
|
+
};
|
|
62
|
+
export const getAllTimePopular = async (page, perPage) => {
|
|
63
|
+
const data = await anilistFetch(ALL_TIME_POPULAR_QUERY, { page, perPage });
|
|
64
|
+
return data.Page;
|
|
65
|
+
};
|
|
66
|
+
export const getMostFavorite = async (page, perPage) => {
|
|
67
|
+
const data = await anilistFetch(ALL_TIME_FAVORITE_QUERY, { page, perPage });
|
|
68
|
+
return data.Page;
|
|
69
|
+
};
|
|
70
|
+
export const getTopRated = async (page, perPage) => {
|
|
71
|
+
const data = await anilistFetch(TOP_RATED_QUERY, { page, perPage });
|
|
72
|
+
return data.Page;
|
|
73
|
+
};
|
|
74
|
+
export const getCurrentlyAiring = async (page, perPage) => {
|
|
75
|
+
const data = await anilistFetch(CURRENTLY_AIRING_QUERY, { page, perPage });
|
|
76
|
+
return data.Page;
|
|
77
|
+
};
|
|
78
|
+
export const getHeroAnime = async (count = 8) => {
|
|
79
|
+
const data = await anilistFetch(HERO_QUERY, { page: 1, perPage: 30 });
|
|
80
|
+
const withTrailers = data.Page.media.filter(m => m.trailer?.id && m.trailer.site && m.bannerImage);
|
|
81
|
+
if (withTrailers.length >= count) {
|
|
82
|
+
return withTrailers.slice(0, count);
|
|
83
|
+
}
|
|
84
|
+
const withBanners = data.Page.media.filter(m => m.bannerImage);
|
|
85
|
+
return withBanners.slice(0, count);
|
|
86
|
+
};
|
|
87
|
+
export const searchAnime = async (filters = {}) => {
|
|
88
|
+
const { search, sort = ["POPULARITY_DESC"], genres, tags, season, seasonYear, format, status, countryOfOrigin, source, page = 1, perPage = 20 } = filters;
|
|
89
|
+
const variables = { page, perPage, sort };
|
|
90
|
+
if (search)
|
|
91
|
+
variables.search = search;
|
|
92
|
+
if (genres?.length)
|
|
93
|
+
variables.genre_in = genres;
|
|
94
|
+
if (tags?.length)
|
|
95
|
+
variables.tag_in = tags;
|
|
96
|
+
if (season)
|
|
97
|
+
variables.season = season;
|
|
98
|
+
if (seasonYear)
|
|
99
|
+
variables.seasonYear = seasonYear;
|
|
100
|
+
if (format)
|
|
101
|
+
variables.format = format;
|
|
102
|
+
if (status)
|
|
103
|
+
variables.status = status;
|
|
104
|
+
if (countryOfOrigin)
|
|
105
|
+
variables.countryOfOrigin = countryOfOrigin;
|
|
106
|
+
if (source)
|
|
107
|
+
variables.source = source;
|
|
108
|
+
const data = await anilistFetch(SEARCH_QUERY, variables);
|
|
109
|
+
return data.Page;
|
|
110
|
+
};
|
|
111
|
+
export const getAnimeDetail = async (id) => {
|
|
112
|
+
const data = await anilistFetch(MEDIA_DETAIL_QUERY, { id });
|
|
113
|
+
return data.Media;
|
|
114
|
+
};
|
|
115
|
+
export const getGenres = async () => {
|
|
116
|
+
const data = await anilistFetch(GENRE_COLLECTION_QUERY, undefined);
|
|
117
|
+
return data.GenreCollection;
|
|
118
|
+
};
|
|
119
|
+
export const getTags = async () => {
|
|
120
|
+
const data = await anilistFetch(TAG_COLLECTION_QUERY, undefined);
|
|
121
|
+
return data.MediaTagCollection.map(t => t.name);
|
|
122
|
+
};
|
|
123
|
+
export const getSettingsAssets = async () => {
|
|
124
|
+
const data = await anilistFetch(SETTINGS_ASSETS_QUERY, undefined);
|
|
125
|
+
const banners = data.banners.media.map((m) => m.bannerImage).filter(Boolean);
|
|
126
|
+
const avatars = data.avatars.media.map((m) => ({
|
|
127
|
+
animeTitle: m.title.english || m.title.romaji,
|
|
128
|
+
characters: m.characters.edges.map((e) => ({
|
|
129
|
+
id: e.node.id,
|
|
130
|
+
name: e.node.name.full,
|
|
131
|
+
image: e.node.image.large,
|
|
132
|
+
})).filter((c) => c.image),
|
|
133
|
+
})).filter((a) => a.characters.length > 0);
|
|
134
|
+
return { banners: Array.from(new Set(banners)), avatars };
|
|
135
|
+
};
|
|
136
|
+
// ─── Meta Mapping ───────────────────────────────────────────────
|
|
137
|
+
function compareTitles(t1, t2) {
|
|
138
|
+
if (!t1 || !t2)
|
|
139
|
+
return 0;
|
|
140
|
+
const s1 = t1.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
141
|
+
const s2 = t2.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
142
|
+
if (s1 === s2)
|
|
143
|
+
return 1;
|
|
144
|
+
if (s1.includes(s2) || s2.includes(s1))
|
|
145
|
+
return 0.8;
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
async function fuzzySearchMapping(anilistId, providerName) {
|
|
149
|
+
let anilistData;
|
|
150
|
+
try {
|
|
151
|
+
const detail = await getAnimeDetail(Number(anilistId));
|
|
152
|
+
anilistData = { title: detail.title };
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
throw new Error(`fuzzySearchMapping requires anilistData with title information to map for ${providerName}, and auto-fetch failed.`);
|
|
156
|
+
}
|
|
157
|
+
const titles = anilistData.title;
|
|
158
|
+
const searchQuery = titles.english || titles.romaji || titles.native;
|
|
159
|
+
if (!searchQuery)
|
|
160
|
+
return null;
|
|
161
|
+
const providerModule = PROVIDERS[providerName];
|
|
162
|
+
if (!providerModule || typeof providerModule.search !== 'function') {
|
|
163
|
+
throw new Error(`Provider ${providerName} does not support search function`);
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const searchRes = await providerModule.search(searchQuery);
|
|
167
|
+
const results = searchRes.results || searchRes.data || [];
|
|
168
|
+
if (results.length === 0)
|
|
169
|
+
return null;
|
|
170
|
+
let bestMatch = results[0];
|
|
171
|
+
let bestScore = 0;
|
|
172
|
+
for (const res of results) {
|
|
173
|
+
let score = 0;
|
|
174
|
+
const resTitle = typeof res.title === 'string' ? res.title : (res.title.english || res.title.romaji || '');
|
|
175
|
+
const scoreEng = compareTitles(resTitle, titles.english || '');
|
|
176
|
+
const scoreRom = compareTitles(resTitle, titles.romaji || '');
|
|
177
|
+
score = Math.max(scoreEng, scoreRom);
|
|
178
|
+
if (score > bestScore) {
|
|
179
|
+
bestScore = score;
|
|
180
|
+
bestMatch = res;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (bestScore >= 0.8) {
|
|
184
|
+
return bestMatch.id;
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
console.error(`Fuzzy search mapping failed for ${providerName}:`, error);
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
export async function fetchAniZipData(anilistId) {
|
|
194
|
+
try {
|
|
195
|
+
const url = `https://api.ani.zip/mappings?anilist_id=${anilistId}`;
|
|
196
|
+
const res = await fetch(url);
|
|
197
|
+
if (!res.ok)
|
|
198
|
+
return null;
|
|
199
|
+
const json = await res.json();
|
|
200
|
+
return json.episodes || null;
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
console.error('Failed to fetch AniZip data:', err);
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
export async function fetchEpisodesByProvider(anilistId, providerName) {
|
|
208
|
+
const providerModule = PROVIDERS[providerName];
|
|
209
|
+
if (!providerModule) {
|
|
210
|
+
throw new Error(`Unknown provider: ${providerName}`);
|
|
211
|
+
}
|
|
212
|
+
let providerAnimeId = null;
|
|
213
|
+
if (WORKER_SUPPORTED_PROVIDERS.includes(providerName)) {
|
|
214
|
+
try {
|
|
215
|
+
const workerUrl = `https://api.kenjitsu.workers.dev/api/anime/anilist/${anilistId}?provider=${providerName}`;
|
|
216
|
+
const workerRes = await getJson(workerUrl);
|
|
217
|
+
if (workerRes && workerRes.provider && workerRes.provider.id) {
|
|
218
|
+
providerAnimeId = workerRes.provider.id;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch (e) {
|
|
222
|
+
console.error(`Worker mapping failed for ${providerName}, falling back if possible...`, e);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (!providerAnimeId) {
|
|
226
|
+
providerAnimeId = await fuzzySearchMapping(anilistId, providerName);
|
|
227
|
+
}
|
|
228
|
+
if (!providerAnimeId) {
|
|
229
|
+
throw new Error(`Could not map AniList ID ${anilistId} to ${providerName}`);
|
|
230
|
+
}
|
|
231
|
+
const animeInfo = await providerModule.fetchAnimeInfo(providerAnimeId);
|
|
232
|
+
let episodes = animeInfo.episodes || animeInfo.data?.episodes || [];
|
|
233
|
+
// Fetch AniZip enrichment data
|
|
234
|
+
const aniZipEpisodes = await fetchAniZipData(anilistId).catch(() => null);
|
|
235
|
+
episodes = episodes.map((ep) => {
|
|
236
|
+
const enriched = {
|
|
237
|
+
...ep,
|
|
238
|
+
providerName,
|
|
239
|
+
};
|
|
240
|
+
if (aniZipEpisodes) {
|
|
241
|
+
const zipEp = aniZipEpisodes[ep.number.toString()];
|
|
242
|
+
if (zipEp) {
|
|
243
|
+
if (!enriched.title && zipEp.title) {
|
|
244
|
+
enriched.title = zipEp.title.en || zipEp.title.ja;
|
|
245
|
+
}
|
|
246
|
+
if (!enriched.image && zipEp.image) {
|
|
247
|
+
enriched.image = zipEp.image;
|
|
248
|
+
}
|
|
249
|
+
if (!enriched.airDate && zipEp.airdate) {
|
|
250
|
+
enriched.airDate = zipEp.airdate;
|
|
251
|
+
}
|
|
252
|
+
if (!enriched.description && zipEp.overview) {
|
|
253
|
+
enriched.description = zipEp.overview;
|
|
254
|
+
}
|
|
255
|
+
if (!enriched.duration && zipEp.length) {
|
|
256
|
+
enriched.duration = zipEp.length * 60; // convert to seconds
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return enriched;
|
|
261
|
+
});
|
|
262
|
+
return episodes;
|
|
263
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Fields selected for cards, carousels, and list items */
|
|
2
|
+
export declare const MEDIA_CARD_FIELDS = "\n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n";
|
|
3
|
+
/** Trending right now — sorted by trending score descending */
|
|
4
|
+
export declare const TRENDING_QUERY = "\n query TrendingAnime($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: TRENDING_DESC, type: ANIME, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
5
|
+
/** Popular this season */
|
|
6
|
+
export declare const POPULAR_THIS_SEASON_QUERY = "\n query PopularThisSeason($page: Int, $perPage: Int, $season: MediaSeason, $seasonYear: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(\n sort: POPULARITY_DESC\n type: ANIME\n season: $season\n seasonYear: $seasonYear\n isAdult: false\n ) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
7
|
+
/** Top upcoming — next season, sorted by popularity */
|
|
8
|
+
export declare const UPCOMING_QUERY = "\n query UpcomingAnime($page: Int, $perPage: Int, $season: MediaSeason, $seasonYear: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(\n sort: POPULARITY_DESC\n type: ANIME\n season: $season\n seasonYear: $seasonYear\n status: NOT_YET_RELEASED\n isAdult: false\n ) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
9
|
+
/** All-time most popular */
|
|
10
|
+
export declare const ALL_TIME_POPULAR_QUERY = "\n query AllTimePopular($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: POPULARITY_DESC, type: ANIME, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
11
|
+
/** All-time most favorited */
|
|
12
|
+
export declare const ALL_TIME_FAVORITE_QUERY = "\n query AllTimeFavorite($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: FAVOURITES_DESC, type: ANIME, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
13
|
+
/** Top rated of all time */
|
|
14
|
+
export declare const TOP_RATED_QUERY = "\n query TopRated($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: SCORE_DESC, type: ANIME, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
15
|
+
/** Currently airing — releasing right now */
|
|
16
|
+
export declare const CURRENTLY_AIRING_QUERY = "\n query CurrentlyAiring($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: POPULARITY_DESC, type: ANIME, status: RELEASING, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
17
|
+
export declare const SEARCH_QUERY = "\n query SearchAnime(\n $page: Int\n $perPage: Int\n $search: String\n $sort: [MediaSort]\n $genre_in: [String]\n $tag_in: [String]\n $season: MediaSeason\n $seasonYear: Int\n $format: MediaFormat\n $status: MediaStatus\n $countryOfOrigin: CountryCode\n $source: MediaSource\n ) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(\n search: $search\n sort: $sort\n type: ANIME\n genre_in: $genre_in\n tag_in: $tag_in\n season: $season\n seasonYear: $seasonYear\n format: $format\n status: $status\n countryOfOrigin: $countryOfOrigin\n source: $source\n isAdult: false\n ) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
18
|
+
export declare const MEDIA_DETAIL_QUERY = "\n query MediaDetail($id: Int) {\n Media(id: $id, type: ANIME) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n \n synonyms\n hashtag\n siteUrl\n characters(sort: [ROLE, RELEVANCE, ID], perPage: 25) {\n edges {\n id\n role\n node {\n id\n name {\n full\n native\n first\n last\n }\n image {\n large\n medium\n }\n }\n voiceActors(language: JAPANESE) {\n id\n name {\n full\n native\n first\n last\n }\n image {\n large\n medium\n }\n languageV2\n }\n }\n }\n staff(sort: RELEVANCE, perPage: 25) {\n edges {\n id\n role\n node {\n id\n name {\n full\n native\n }\n image {\n large\n medium\n }\n primaryOccupations\n }\n }\n }\n streamingEpisodes {\n title\n thumbnail\n url\n site\n }\n externalLinks {\n id\n url\n site\n type\n icon\n color\n }\n relations {\n edges {\n id\n relationType(version: 2)\n node {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n recommendations(sort: RATING_DESC, perPage: 10) {\n nodes {\n id\n rating\n mediaRecommendation {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n\n }\n }\n";
|
|
19
|
+
export declare const HERO_QUERY = "\n query HeroAnime($page: Int, $perPage: Int) {\n Page(page: $page, perPage: $perPage) {\n pageInfo {\n total\n currentPage\n lastPage\n hasNextPage\n perPage\n }\n media(sort: TRENDING_DESC, type: ANIME, isAdult: false) {\n \n id\n idMal\n title {\n romaji\n english\n native\n userPreferred\n }\n coverImage {\n extraLarge\n large\n medium\n color\n }\n bannerImage\n format\n type\n status\n episodes\n duration\n season\n seasonYear\n averageScore\n meanScore\n popularity\n favourites\n trending\n genres\n description(asHtml: false)\n trailer {\n id\n site\n thumbnail\n }\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n source\n countryOfOrigin\n isAdult\n studios(isMain: true) {\n nodes {\n id\n name\n isAnimationStudio\n siteUrl\n }\n }\n nextAiringEpisode {\n id\n airingAt\n timeUntilAiring\n episode\n }\n\n }\n }\n }\n";
|
|
20
|
+
export declare const GENRE_COLLECTION_QUERY = "\n query GenreCollection {\n GenreCollection\n }\n";
|
|
21
|
+
export declare const TAG_COLLECTION_QUERY = "\n query TagCollection {\n MediaTagCollection {\n name\n }\n }\n";
|
|
22
|
+
export declare const SETTINGS_ASSETS_QUERY = "\n query SettingsAssets {\n banners: Page(perPage: 20) {\n media(sort: POPULARITY_DESC, type: ANIME, isAdult: false) {\n id\n bannerImage\n }\n }\n avatars: Page(perPage: 10) {\n media(sort: POPULARITY_DESC, type: ANIME, isAdult: false) {\n id\n title {\n romaji\n english\n }\n characters(sort: FAVOURITES_DESC, perPage: 5) {\n edges {\n node {\n id\n name {\n full\n }\n image {\n large\n }\n }\n }\n }\n }\n }\n }\n";
|