A simple API wrapper for fetching anime sources from anicrush.to.
- Install dependencies:
npm install- Start the server:
npm startFor development with auto-reload:
npm run devGET /api/mapper/{anilistId}
Maps an AniList ID to anicrush.to anime ID and episode information.
Example Request:
GET http://localhost:3000/api/mapper/21
Example Response:
{
"anilist_id": "21",
"anicrush_id": "vRPjMA",
"titles": {
"romaji": "One Piece",
"english": "One Piece",
"native": "ワンピース",
"anicrush": "One Piece"
},
"total_episodes": 1000,
"episodes": [
{
"number": 1,
"id": "vRPjMA&episode=1"
},
// ... more episodes
],
"format": "TV",
"status": "RELEASING"
}GET /api/anime/search
Query Parameters:
keyword(required): Search termpage(optional): Page number (default: 1)limit(optional): Results per page (default: 24)
GET /api/anime/episodes
Query Parameters:
movieId(required): The ID of the movie/anime
GET /api/anime/servers/{id}
Query Parameters:
movieId(required): The ID of the movie/animeepisode(optional): Episode number (default: 1)
GET /api/anime/sources
Query Parameters:
movieId(required): The ID of the movie/anime (e.g., "vRPjMA")episode(optional): Episode number (default: 1)server(optional): Server number (default: 4)subOrDub(optional): "sub" or "dub" (default: "sub")
Example Request:
GET http://localhost:3000/api/anime/sources?movieId=vRPjMA&episode=1&server=4&subOrDub=sub
GET /api/anime/hls/{animeId}?episode={ep}&server={id}&subOrDub={type}
Fetches HLS (HTTP Live Streaming) links with additional metadata for a specific episode.
Query Parameters:
episode(optional): Episode number (default: 1)server(optional): Server number (default: 4)subOrDub(optional): "sub" or "dub" (default: "sub")
Example Request:
GET http://localhost:3000/api/anime/hls/vRPjMA?episode=1&server=4&subOrDub=sub
Example Response:
{
"status": true,
"result": {
"sources": [
{
"file": "https://example.com/hls/video.m3u8",
"type": "hls"
}
],
"tracks": [
{
"file": "https://example.com/subtitles.vtt",
"label": "English",
"kind": "captions"
}
],
"intro": {
"start": 0,
"end": 90
},
"outro": {
"start": 1290,
"end": 1380
},
"server": 4
}
}GET /health
Returns the API status.
The API will return appropriate error messages with corresponding HTTP status codes:
- 400: Bad Request (missing required parameters)
- 404: Not Found (anime or episode not found)
- 500: Internal Server Error (server-side issues)
- The API includes necessary headers for authentication
- CORS is enabled for cross-origin requests
- The server runs on port 3000 by default (can be changed via PORT environment variable)