docs: add dub/sub switch documentation to README

This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 21:51:21 +05:30
parent 58c0e8be60
commit 18e4a84a66
+29
View File
@@ -445,6 +445,35 @@ curl "https://anikototvapi.vercel.app/api/servers?ids=SlNVT25JaFlCMnZOe..."
curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbz..." curl "https://anikototvapi.vercel.app/api/stream?id=MTF1dkFtaW9BRTZPbz..."
``` ```
### Dub & Sub Switch
Servers have a `type` field — use it to pick sub or dub:
```json
// Step 2 response
{
"results": [
{ "type": "sub", "name": "HD-1", "link_id": "MTF1..." },
{ "type": "sub", "name": "Vidstream-2", "link_id": "MTF1..." },
{ "type": "dub", "name": "HD-1", "link_id": "MTF1..." },
{ "type": "dub", "name": "Vidstream-2", "link_id": "MTF1..." }
]
}
```
```javascript
// Pick dub or sub
const servers = await fetch('/api/servers?ids=...').then(r => r.json());
const dubServer = servers.results.find(s => s.type === 'dub');
const subServer = servers.results.find(s => s.type === 'sub');
// Get stream URL
const stream = await fetch(`/api/stream?id=${dubServer.link_id}`).then(r => r.json());
// stream.results.url = "https://megaplay.buzz/stream/s-5/169837/dub"
```
> **Note:** Not all anime have dub. Check `sub`/`dub` counts in search or home response.
--- ---
> ## 🏠 GET Home Info > ## 🏠 GET Home Info