From 18e4a84a6618f0a8b6686c6b524017ee893cfb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CA=9C=C9=AA=C9=B4=E1=B4=87=C9=AA=20N=E1=B4=8F=E1=B4=9C?= =?UTF-8?q?=E1=B4=A2=E1=B4=87=C9=B4?= <157171073+Shineii86@users.noreply.github.com> Date: Mon, 8 Jun 2026 21:51:21 +0530 Subject: [PATCH] docs: add dub/sub switch documentation to README --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index da4ef7b..c6863e2 100644 --- a/README.md +++ b/README.md @@ -445,6 +445,35 @@ curl "https://anikototvapi.vercel.app/api/servers?ids=SlNVT25JaFlCMnZOe..." 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