mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 02:45:10 +00:00
docs: fix streaming flow parameter - use animeId instead of slug
This commit is contained in:
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2.0.2] - 2026-07-05
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- **Documentation**: Fixed streaming flow guide — `/api/episodes/:slug` corrected to `/api/episodes/:animeId`
|
||||||
|
- **Documentation**: Fixed all examples using `road-of-naruto-ggjw8` slug for episodes to use `958` animeId
|
||||||
|
- **Documentation**: Fixed JavaScript/Node.js streaming examples to use `animeId` parameter instead of `animeSlug`
|
||||||
|
- **Documentation**: Updated cURL examples to use correct animeId (958) for episodes endpoint
|
||||||
|
- **Documentation**: Updated architecture.md streaming flow diagram to reflect correct endpoint
|
||||||
|
|
||||||
## [2.0.1] - 2026-07-05
|
## [2.0.1] - 2026-07-05
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -438,14 +438,14 @@ https://anikototvapi.vercel.app/api
|
|||||||
To get a stream URL, follow these 3 steps:
|
To get a stream URL, follow these 3 steps:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Step 1: Get episodes (returns server_ids)
|
# Step 1: Get episodes by animeId (returns server_ids)
|
||||||
curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/episodes/958"
|
||||||
|
|
||||||
# Step 2: Get servers (pass server_ids from Step 1)
|
# Step 2: Get servers (pass server_ids from Step 1)
|
||||||
curl "https://anikototvapi.vercel.app/api/servers?ids=SlNVT25JaFlCMnZOe..."
|
curl "https://anikototvapi.vercel.app/api/servers?ids=dXNCT3hNQzk3THhSTW8ySnM5..."
|
||||||
|
|
||||||
# Step 3: Get stream URL (pass link_id from Step 2)
|
# Step 3: Get stream URL (pass link_id from Step 2)
|
||||||
curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbz..."
|
curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbzJJRElFZUZr..."
|
||||||
```
|
```
|
||||||
|
|
||||||
### Dub & Sub Switch
|
### Dub & Sub Switch
|
||||||
@@ -796,17 +796,17 @@ console.log(resp.data);
|
|||||||
|
|
||||||
| Parameter | Type | Mandatory | Default | Description |
|
| Parameter | Type | Mandatory | Default | Description |
|
||||||
| :-------: | :--: | :-------: | :-----: | :---------: |
|
| :-------: | :--: | :-------: | :-----: | :---------: |
|
||||||
| `id` | `string` | Yes ✔️ | — | Anime slug |
|
| `id` | `string` | Yes ✔️ | — | Anime slug or animeId |
|
||||||
|
|
||||||
#### Example of request
|
#### Example of request
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/episodes/one-piece-odmau"
|
curl "https://anikototvapi.vercel.app/api/episodes/958"
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const resp = await axios.get("https://anikototvapi.vercel.app/api/episodes/one-piece-odmau");
|
const resp = await axios.get("https://anikototvapi.vercel.app/api/episodes/958");
|
||||||
console.log(resp.data);
|
console.log(resp.data);
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -914,13 +914,13 @@ console.log(resp.data);
|
|||||||
#### Example of request
|
#### Example of request
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/servers?ids={episodeIds}"
|
curl "https://anikototvapi.vercel.app/api/servers?ids={server_ids}"
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const resp = await axios.get("https://anikototvapi.vercel.app/api/servers", {
|
const resp = await axios.get("https://anikototvapi.vercel.app/api/servers", {
|
||||||
params: { ids: "yourEpisodeIds" }
|
params: { ids: "yourServerIds" }
|
||||||
});
|
});
|
||||||
console.log(resp.data);
|
console.log(resp.data);
|
||||||
```
|
```
|
||||||
@@ -1016,13 +1016,13 @@ Server list for an episode — returns available streaming servers with their na
|
|||||||
| `ids` | `string` | **required** | `server_ids` from `/episodes` response (base64-encoded) |
|
| `ids` | `string` | **required** | `server_ids` from `/episodes` response (base64-encoded) |
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/servers?ids={episodeIds}"
|
curl "https://anikototvapi.vercel.app/api/servers?ids={server_ids}"
|
||||||
```
|
```
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
const resp = await axios.get("https://anikototvapi.vercel.app/api/servers", {
|
const resp = await axios.get("https://anikototvapi.vercel.app/api/servers", {
|
||||||
params: { ids: "yourEpisodeIds" }
|
params: { ids: "yourServerIds" }
|
||||||
});
|
});
|
||||||
console.log(resp.data);
|
console.log(resp.data);
|
||||||
```
|
```
|
||||||
@@ -2172,7 +2172,7 @@ CMD ["node", "server.js"]
|
|||||||
|:---|:---|:---|
|
|:---|:---|:---|
|
||||||
| ❌ `npm install` fails | Node.js version too old | Upgrade to Node.js 20+ (`node -v`) |
|
| ❌ `npm install` fails | Node.js version too old | Upgrade to Node.js 20+ (`node -v`) |
|
||||||
| ❌ 500 error on filter | Missing `keyword` param | Add `?keyword=` (even empty) to filter requests |
|
| ❌ 500 error on filter | Missing `keyword` param | Add `?keyword=` (even empty) to filter requests |
|
||||||
| ❌ Empty episodes array | AJAX not loaded | Use `/api/episodes/:slug` which fetches via AJAX |
|
| ❌ Empty episodes array | Wrong parameter | Use `/api/episodes/:animeId` with numeric animeId (e.g., 958) |
|
||||||
| ❌ CORS errors | Frontend domain blocked | CORS is `*` — check browser extension |
|
| ❌ CORS errors | Frontend domain blocked | CORS is `*` — check browser extension |
|
||||||
| ❌ 404 on API routes | Wrong URL format | Use `/api/` prefix, not just `/` |
|
| ❌ 404 on API routes | Wrong URL format | Use `/api/` prefix, not just `/` |
|
||||||
| ❌ Deploy fails on Vercel | Build error | Check `node server.js` locally first |
|
| ❌ Deploy fails on Vercel | Build error | Check `node server.js` locally first |
|
||||||
@@ -2204,7 +2204,7 @@ Use <code>/api/search?keyword=your+search</code>. Results include title, poster,
|
|||||||
<details>
|
<details>
|
||||||
<summary><b>📺 How do I get episode lists?</b></summary>
|
<summary><b>📺 How do I get episode lists?</b></summary>
|
||||||
<br/>
|
<br/>
|
||||||
Use <code>/api/episodes/:slug</code> where <code>:slug</code> is the anime URL slug (e.g., <code>one-piece-odmau</code>). This fetches episode data via AJAX for accuracy. The response includes <code>animeId</code>, <code>totalEpisodes</code>, and <code>episodes</code> array.
|
Use <code>/api/episodes/:id</code> where <code>:id</code> is the anime slug or animeId (e.g., <code>958</code> for Naruto). The response includes <code>animeId</code>, <code>totalEpisodes</code>, and <code>episodes</code> array with <code>server_ids</code> for each episode.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ Client Response
|
|||||||
## Streaming Flow
|
## Streaming Flow
|
||||||
|
|
||||||
```
|
```
|
||||||
/api/episodes/:slug
|
/api/episodes/:animeId
|
||||||
↓
|
↓
|
||||||
Returns: server_ids, animeId, totalEpisodes
|
Returns: server_ids, animeId, totalEpisodes
|
||||||
↓
|
↓
|
||||||
|
|||||||
+9
-8
@@ -169,12 +169,12 @@ Get episode list for an anime.
|
|||||||
|
|
||||||
| Param | Type | Required | Description |
|
| Param | Type | Required | Description |
|
||||||
|-------|------|----------|-------------|
|
|-------|------|----------|-------------|
|
||||||
| `id` | string | Yes | Anime slug |
|
| `id` | string | Yes | Anime slug or animeId |
|
||||||
|
|
||||||
**Request:**
|
**Request:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/episodes/958"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
@@ -183,19 +183,20 @@ curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
|||||||
{
|
{
|
||||||
"success": true,
|
"success": true,
|
||||||
"results": {
|
"results": {
|
||||||
"animeId": "7174",
|
"animeId": 958,
|
||||||
"totalEpisodes": 1,
|
"slug": "958",
|
||||||
|
"totalEpisodes": 220,
|
||||||
"episodes": [
|
"episodes": [
|
||||||
{
|
{
|
||||||
"id": "110289",
|
"id": "16638",
|
||||||
"episode_no": 1,
|
"episode_no": 1,
|
||||||
"slug": "1",
|
"slug": "1",
|
||||||
"title": "",
|
"title": "",
|
||||||
"active": true,
|
"active": true,
|
||||||
"href": "#",
|
"href": "#",
|
||||||
"server_ids": "SlNVT25JaFlCMnZOeXZ2aG5takIxL2EybGl4TzJoNE1pN3JXdFNlODVocWtTckt1SFR0YUxrNzNhanQ2MEJoVG9UUEZNeWJOMm1uUThpYjNxejhhUEZWMitnNFFtTUNMYjBTc1FJZjZNNFZPNm5LMlVuTnpOU25ScUI1dHVGczM0UzluZ2xITG5qbExabnBDdGphY0VRPT0",
|
"server_ids": "dXNCT3hNQzk3THhSTW8ySnM5...",
|
||||||
"timestamp": "1729249503",
|
"timestamp": "1729197616",
|
||||||
"mal_id": "53236"
|
"mal_id": "20"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-16
@@ -21,26 +21,26 @@ curl "https://anikototvapi.vercel.app/api/search?keyword=naruto"
|
|||||||
### Anime Info
|
### Anime Info
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/info?id=road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/info?id=naruto-eybxz"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Episodes
|
### Episodes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/episodes/958"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Servers
|
### Servers
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
SERVER_IDS=$(curl -s "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8" | python3 -c "import sys,json; print(json.load(sys.stdin)['results']['episodes'][0]['server_ids'])")
|
SERVER_IDS=$(curl -s "https://anikototvapi.vercel.app/api/episodes/958" | python3 -c "import sys,json; print(json.load(sys.stdin)['results']['episodes'][0]['server_ids'])")
|
||||||
curl "https://anikototvapi.vercel.app/api/servers?ids=$SERVER_IDS"
|
curl "https://anikototvapi.vercel.app/api/servers?ids=$SERVER_IDS"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Stream URL
|
### Stream URL
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
LINK_ID=$(curl -s "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8" | python3 -c "import sys,json; print(json.load(sys.stdin)['results']['episodes'][0]['server_ids'])" | xargs -I{} curl -s "https://anikototvapi.vercel.app/api/servers?ids={}" | python3 -c "import sys,json; print(json.load(sys.stdin)['results'][0]['link_id'])")
|
LINK_ID=$(curl -s "https://anikototvapi.vercel.app/api/episodes/958" | python3 -c "import sys,json; print(json.load(sys.stdin)['results']['episodes'][0]['server_ids'])" | xargs -I{} curl -s "https://anikototvapi.vercel.app/api/servers?ids={}" | python3 -c "import sys,json; print(json.load(sys.stdin)['results'][0]['link_id'])")
|
||||||
curl "https://anikototvapi.vercel.app/api/stream?id=$LINK_ID"
|
curl "https://anikototvapi.vercel.app/api/stream?id=$LINK_ID"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -140,15 +140,15 @@ async function getAnimeInfo(slug) {
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
getAnimeInfo('road-of-naruto-ggjw8');
|
getAnimeInfo('naruto-eybxz');
|
||||||
```
|
```
|
||||||
|
|
||||||
### Full Streaming Flow
|
### Full Streaming Flow
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
async function getStreamUrl(animeSlug) {
|
async function getStreamUrl(animeId) {
|
||||||
// Step 1: Get episodes
|
// Step 1: Get episodes
|
||||||
const episodesRes = await fetch(`https://anikototvapi.vercel.app/api/episodes/${animeSlug}`);
|
const episodesRes = await fetch(`https://anikototvapi.vercel.app/api/episodes/${animeId}`);
|
||||||
const episodesData = await episodesRes.json();
|
const episodesData = await episodesRes.json();
|
||||||
const episodes = episodesData.results.episodes;
|
const episodes = episodesData.results.episodes;
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ async function getStreamUrl(animeSlug) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Usage
|
// Usage
|
||||||
getStreamUrl('road-of-naruto-ggjw8')
|
getStreamUrl(958)
|
||||||
.then(url => {
|
.then(url => {
|
||||||
console.log('Stream URL:', url);
|
console.log('Stream URL:', url);
|
||||||
// Use with video player
|
// Use with video player
|
||||||
@@ -268,11 +268,11 @@ searchAnime('naruto').then(results => {
|
|||||||
```javascript
|
```javascript
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
|
||||||
async function getStreamUrl(animeSlug) {
|
async function getStreamUrl(animeId) {
|
||||||
const BASE = 'https://anikototvapi.vercel.app/api';
|
const BASE = 'https://anikototvapi.vercel.app/api';
|
||||||
|
|
||||||
// Step 1: Get episodes
|
// Step 1: Get episodes
|
||||||
const { data: episodesData } = await axios.get(`${BASE}/episodes/${animeSlug}`);
|
const { data: episodesData } = await axios.get(`${BASE}/episodes/${animeId}`);
|
||||||
const episodes = episodesData.results.episodes;
|
const episodes = episodesData.results.episodes;
|
||||||
|
|
||||||
if (!episodes || episodes.length === 0) {
|
if (!episodes || episodes.length === 0) {
|
||||||
@@ -302,7 +302,7 @@ async function getStreamUrl(animeSlug) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Usage
|
// Usage
|
||||||
getStreamUrl('road-of-naruto-ggjw8')
|
getStreamUrl(958)
|
||||||
.then(url => console.log('Stream URL:', url))
|
.then(url => console.log('Stream URL:', url))
|
||||||
.catch(err => console.error('Error:', err.message));
|
.catch(err => console.error('Error:', err.message));
|
||||||
```
|
```
|
||||||
@@ -312,12 +312,12 @@ getStreamUrl('road-of-naruto-ggjw8')
|
|||||||
```javascript
|
```javascript
|
||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
|
||||||
async function getEpisodeList(animeSlug) {
|
async function getEpisodeList(animeId) {
|
||||||
const { data } = await axios.get(`https://anikototvapi.vercel.app/api/episodes/${animeSlug}`);
|
const { data } = await axios.get(`https://anikototvapi.vercel.app/api/episodes/${animeId}`);
|
||||||
|
|
||||||
const { animeId, totalEpisodes, episodes } = data.results;
|
const { animeId: id, totalEpisodes, episodes } = data.results;
|
||||||
|
|
||||||
console.log(`Anime ID: ${animeId}`);
|
console.log(`Anime ID: ${id}`);
|
||||||
console.log(`Total Episodes: ${totalEpisodes}`);
|
console.log(`Total Episodes: ${totalEpisodes}`);
|
||||||
console.log(`Episodes available: ${episodes.length}`);
|
console.log(`Episodes available: ${episodes.length}`);
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ async function getEpisodeList(animeSlug) {
|
|||||||
return data.results;
|
return data.results;
|
||||||
}
|
}
|
||||||
|
|
||||||
getEpisodeList('road-of-naruto-ggjw8');
|
getEpisodeList(958);
|
||||||
```
|
```
|
||||||
|
|
||||||
### Suggestions
|
### Suggestions
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ curl https://anikototvapi.vercel.app/api
|
|||||||
curl "https://anikototvapi.vercel.app/api/search?keyword=naruto"
|
curl "https://anikototvapi.vercel.app/api/search?keyword=naruto"
|
||||||
|
|
||||||
# Get anime info
|
# Get anime info
|
||||||
curl "https://anikototvapi.vercel.app/api/info?id=road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/info?id=naruto-eybxz"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Live Response — Homepage:**
|
**Live Response — Homepage:**
|
||||||
|
|||||||
+34
-33
@@ -5,7 +5,7 @@ This guide explains how to get streaming URLs from AniKotoAPI in 3 steps.
|
|||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
```
|
```
|
||||||
Step 1: Get Episodes → /api/episodes/:slug
|
Step 1: Get Episodes → /api/episodes/:id
|
||||||
Step 2: Get Servers → /api/servers?ids={server_ids}
|
Step 2: Get Servers → /api/servers?ids={server_ids}
|
||||||
Step 3: Get Stream URL → /api/stream?id={link_id}
|
Step 3: Get Stream URL → /api/stream?id={link_id}
|
||||||
```
|
```
|
||||||
@@ -14,12 +14,12 @@ Step 3: Get Stream URL → /api/stream?id={link_id}
|
|||||||
|
|
||||||
## Step 1: Get Episodes
|
## Step 1: Get Episodes
|
||||||
|
|
||||||
Each anime has multiple episodes. Fetch the episode list with the anime slug.
|
Each anime has multiple episodes. Fetch the episode list with the anime slug or animeId.
|
||||||
|
|
||||||
**Request:**
|
**Request:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
curl "https://anikototvapi.vercel.app/api/episodes/958"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
@@ -28,19 +28,20 @@ curl "https://anikototvapi.vercel.app/api/episodes/road-of-naruto-ggjw8"
|
|||||||
{
|
{
|
||||||
"success": true,
|
"success": true,
|
||||||
"results": {
|
"results": {
|
||||||
"animeId": "7174",
|
"animeId": 958,
|
||||||
"totalEpisodes": 1,
|
"slug": "958",
|
||||||
|
"totalEpisodes": 220,
|
||||||
"episodes": [
|
"episodes": [
|
||||||
{
|
{
|
||||||
"id": "110289",
|
"id": "16638",
|
||||||
"episode_no": 1,
|
"episode_no": 1,
|
||||||
"slug": "1",
|
"slug": "1",
|
||||||
"title": "",
|
"title": "",
|
||||||
"active": true,
|
"active": true,
|
||||||
"href": "#",
|
"href": "#",
|
||||||
"server_ids": "SlNVT25JaFlCMnZOeXZ2aG5takIxL2EybGl4TzJoNE1pN3JXdFNlODVocWtTckt1SFR0YUxrNzNhanQ2MEJoVG9UUEZNeWJOMm1uUThpYjNxejhhUEZWMitnNFFtTUNMYjBTc1FJZjZNNFZPNm5LMlVuTnpOU25ScUI1dHVGczM0UzluZ2xITG5qbExabnBDdGphY0VRPT0",
|
"server_ids": "dXNCT3hNQzk3THhSTW8ySnM5...",
|
||||||
"timestamp": "1729249503",
|
"timestamp": "1729197616",
|
||||||
"mal_id": "53236"
|
"mal_id": "20"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -58,7 +59,7 @@ Each episode has multiple servers. Use the `server_ids` from Step 1.
|
|||||||
**Request:**
|
**Request:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/servers?ids=SlNVT25JaFlCMnZOeXZ2aG5takIxL2EybGl4TzJoNE1pN3JXdFNlODVocWtTckt1SFR0YUxrNzNhanQ2MEJoVG9UUEZNeWJOMm1uUThpYjNxejhhUEZWMitnNFFtTUNMYjBTc1FJZjZNNFZPNm5LMlVuTnpOU25ScUI1dHVGczM0UzluZ2xITG5qbExabnBDdGphY0VRPT0"
|
curl "https://anikototvapi.vercel.app/api/servers?ids=dXNCT3hNQzk3THhSTW8ySnM5..."
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
@@ -69,19 +70,19 @@ curl "https://anikototvapi.vercel.app/api/servers?ids=SlNVT25JaFlCMnZOeXZ2aG5tak
|
|||||||
"results": [
|
"results": [
|
||||||
{
|
{
|
||||||
"type": "sub",
|
"type": "sub",
|
||||||
"ep_id": "110289",
|
"ep_id": "16638",
|
||||||
"link_id": "MTF1dkFtaW9BRTZPbzJJRElFZUZrOWdjeldjOERLaWNMMXFNbVB3WUJqOHZGS2FSWVgvbVJraVpIV1dQRjRoN01hOFUvYmxsWXFYNGtiR0h5OWdGQWc9PQ",
|
"link_id": "MTF1dkFtaW9BRTZPbzJJRElFZUZr...",
|
||||||
"cmid": "animixplay-fqs",
|
"cmid": "animixplay-fqsqfvdf4u",
|
||||||
"sv_id": "1",
|
"sv_id": "8e4",
|
||||||
"name": "HD-1"
|
"name": "VidPlay-1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "sub",
|
"type": "sub",
|
||||||
"ep_id": "110289",
|
"ep_id": "16638",
|
||||||
"link_id": "MTF1dkFtaW9BRTZPbzJJRElFZUZrOWdjeldjOERLaWNMMXFNbVB3WUJqOEZ4cFNpMDdQbnV1S3dNdklpRkhWbzRsVmgxSGx4YWx3LytPcnZXU0RCVHc9PQ",
|
"link_id": "MTF1dkFtaW9BRTZPbzJJRElFZUZr...",
|
||||||
"cmid": "animixplay-fqs",
|
"cmid": "animixplay-fqsqfvdf4u",
|
||||||
"sv_id": "2",
|
"sv_id": "323",
|
||||||
"name": "Vidstream-2"
|
"name": "HD-1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -98,7 +99,7 @@ Get the actual streaming URL using the `link_id` from Step 2.
|
|||||||
**Request:**
|
**Request:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbzJJRElFZUZrOWdjeldjOERLaWNMMXFNbVB3WUJqOHZGS2FSWVgvbVJraVpIV1dQRjRoN01hOFUvYmxsWXFYNGtiR0h5OWdGQWc9PQ"
|
curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbzJJRElFZUZr..."
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
@@ -107,8 +108,8 @@ curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbzJJRElFZUZr
|
|||||||
{
|
{
|
||||||
"success": true,
|
"success": true,
|
||||||
"results": {
|
"results": {
|
||||||
"linkId": "MTF1dkFtaW9BRTZPbzJJRElFZUZrOWdjeldjOERLaWNMMXFNbVB3WUJqOHZGS2FSWVgvbVJraVpIV1dQRjRoN01hOFUvYmxsWXFYNGtiR0h5OWdGQWc9PQ",
|
"linkId": "MTF1dkFtaW9BRTZPbzJJRElFZUZr...",
|
||||||
"url": "https://megaplay.buzz/stream/s-5/94736/sub",
|
"url": "https://vidtube.site/stream/aVlsNDR3MnRLbWRvQUFBbWJUNERLQT09/sub",
|
||||||
"skipData": {
|
"skipData": {
|
||||||
"intro": [0, 0],
|
"intro": [0, 0],
|
||||||
"outro": [0, 0]
|
"outro": [0, 0]
|
||||||
@@ -124,9 +125,9 @@ curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbzJJRElFZUZr
|
|||||||
## JavaScript Example
|
## JavaScript Example
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
async function getStreamUrl(animeSlug) {
|
async function getStreamUrl(animeId) {
|
||||||
// Step 1: Get episodes
|
// Step 1: Get episodes
|
||||||
const episodesRes = await fetch(`https://anikototvapi.vercel.app/api/episodes/${animeSlug}`);
|
const episodesRes = await fetch(`https://anikototvapi.vercel.app/api/episodes/${animeId}`);
|
||||||
const episodesData = await episodesRes.json();
|
const episodesData = await episodesRes.json();
|
||||||
const episodes = episodesData.results.episodes;
|
const episodes = episodesData.results.episodes;
|
||||||
|
|
||||||
@@ -146,18 +147,18 @@ async function getStreamUrl(animeSlug) {
|
|||||||
throw new Error('No servers found');
|
throw new Error('No servers found');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pick first server (HD-1)
|
// Pick first server (VidPlay-1)
|
||||||
const linkId = servers[0].link_id;
|
const linkId = servers[0].link_id;
|
||||||
|
|
||||||
// Step 3: Get stream URL
|
// Step 3: Get stream URL
|
||||||
const streamRes = await fetch(`https://anikototvapi.vercel.app/api/stream?id=${linkId}`);
|
const streamRes = await fetch(`https://anikototvapi.vercel.app/api/stream?id=${linkId}`);
|
||||||
const streamData = await streamRes.json();
|
const streamData = await streamRes.json();
|
||||||
|
|
||||||
return streamData.results.url; // "https://megaplay.buzz/stream/s-5/94736/sub"
|
return streamData.results.url; // "https://vidtube.site/stream/..."
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage
|
// Usage
|
||||||
getStreamUrl('road-of-naruto-ggjw8')
|
getStreamUrl(958)
|
||||||
.then(url => console.log('Stream URL:', url))
|
.then(url => console.log('Stream URL:', url))
|
||||||
.catch(err => console.error('Error:', err));
|
.catch(err => console.error('Error:', err));
|
||||||
```
|
```
|
||||||
@@ -169,11 +170,11 @@ getStreamUrl('road-of-naruto-ggjw8')
|
|||||||
```python
|
```python
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
def get_stream_url(anime_slug):
|
def get_stream_url(anime_id):
|
||||||
base = "https://anikototvapi.vercel.app/api"
|
base = "https://anikototvapi.vercel.app/api"
|
||||||
|
|
||||||
# Step 1: Get episodes
|
# Step 1: Get episodes
|
||||||
episodes_res = requests.get(f"{base}/episodes/{anime_slug}")
|
episodes_res = requests.get(f"{base}/episodes/{anime_id}")
|
||||||
episodes_data = episodes_res.json()
|
episodes_data = episodes_res.json()
|
||||||
episodes = episodes_data['results']['episodes']
|
episodes = episodes_data['results']['episodes']
|
||||||
|
|
||||||
@@ -199,7 +200,7 @@ def get_stream_url(anime_slug):
|
|||||||
return stream_data['results']['url']
|
return stream_data['results']['url']
|
||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
url = get_stream_url('road-of-naruto-ggjw8')
|
url = get_stream_url(958)
|
||||||
print(f"Stream URL: {url}")
|
print(f"Stream URL: {url}")
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -247,7 +248,7 @@ player.source = {
|
|||||||
|
|
||||||
| Issue | Solution |
|
| Issue | Solution |
|
||||||
|-------|----------|
|
|-------|----------|
|
||||||
| "No episodes found" | Check the anime slug is correct (use `/api/search` first) |
|
| "No episodes found" | Check the anime ID is correct (use `/api/search` first to find slug, then use animeId) |
|
||||||
| "No servers found" | The `server_ids` may be invalid, try another episode |
|
| "No servers found" | The `server_ids` may be invalid, try another episode |
|
||||||
| Stream URL 403 | Some servers require specific referrer headers |
|
| Stream URL 403 | Some servers require specific referrer headers |
|
||||||
| CORS error | Use a proxy or access from server-side |
|
| CORS error | Use a proxy or access from server-side |
|
||||||
@@ -261,7 +262,7 @@ For a simpler approach, use the `/watch` endpoint which returns episode data, se
|
|||||||
**Request:**
|
**Request:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl "https://anikototvapi.vercel.app/api/watch?slug=road-of-naruto-ggjw8&ep=1"
|
curl "https://anikototvapi.vercel.app/api/watch?slug=naruto-eybxz&ep=1"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Response includes:**
|
**Response includes:**
|
||||||
|
|||||||
Reference in New Issue
Block a user