mirror of
https://gitlab.com/vyla-entertainment/documentation.git
synced 2026-11-14 22:47:26 -05:00
fixed syntax issues
This commit is contained in:
@@ -4,25 +4,22 @@
|
||||
|
||||
## Subtitle Endpoints
|
||||
|
||||
Stream API provides dedicated REST endpoints to fetch subtitle tracks independently from video streams. Subtitles are discovered and parsed into web-standard `.vtt` or `.srt` formats.
|
||||
Retrieve subtitle tracks independently from video streams in `.vtt` or `.srt` formats.
|
||||
|
||||
---
|
||||
|
||||
### 1. Movie Subtitles
|
||||
### 1. Movie Subtitles: `GET /subtitles/movie/:id`
|
||||
|
||||
```http
|
||||
GET /subtitles/movie/:id HTTP/1.1
|
||||
Host: your-api.example.com
|
||||
GET /subtitles/movie/155 HTTP/1.1
|
||||
Host: api.vyla.cc
|
||||
```
|
||||
|
||||
#### Path Parameters
|
||||
| Parameter | Type | Required | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `id` | `integer` | Required | Numeric TMDB Movie ID (e.g. `155`) |
|
||||
**Parameters:**
|
||||
- `id` *(number, required)* — TMDB Movie ID (e.g. `155`).
|
||||
|
||||
#### Example Request & Response
|
||||
```bash
|
||||
curl https://your-api.example.com/subtitles/movie/155
|
||||
curl https://api.vyla.cc/subtitles/movie/155
|
||||
```
|
||||
|
||||
```json
|
||||
@@ -30,21 +27,15 @@ curl https://your-api.example.com/subtitles/movie/155
|
||||
"subtitles": [
|
||||
{
|
||||
"label": "English",
|
||||
"file": "https://your-api.example.com/api?url=https%3A%2F%2Fsubtitles.org%2Fen.vtt",
|
||||
"file": "https://api.vyla.cc/api?url=https%3A%2F%2Fsubtitles.org%2Fen.vtt",
|
||||
"type": "vtt",
|
||||
"source": "opensubtitles"
|
||||
},
|
||||
{
|
||||
"label": "Spanish",
|
||||
"file": "https://your-api.example.com/api?url=https%3A%2F%2Fsubtitles.org%2Fes.vtt",
|
||||
"file": "https://api.vyla.cc/api?url=https%3A%2F%2Fsubtitles.org%2Fes.vtt",
|
||||
"type": "vtt",
|
||||
"source": "opensubtitles"
|
||||
},
|
||||
{
|
||||
"label": "French",
|
||||
"file": "https://your-api.example.com/api?url=https%3A%2F%2Fsubtitles.org%2Ffr.srt",
|
||||
"type": "srt",
|
||||
"source": "subdl"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -52,41 +43,37 @@ curl https://your-api.example.com/subtitles/movie/155
|
||||
|
||||
---
|
||||
|
||||
### 2. Television Episode Subtitles
|
||||
### 2. Television Episode Subtitles: `GET /subtitles/tv/:id/:season/:episode`
|
||||
|
||||
```http
|
||||
GET /subtitles/tv/:id/:season/:episode HTTP/1.1
|
||||
Host: your-api.example.com
|
||||
GET /subtitles/tv/1396/1/1 HTTP/1.1
|
||||
Host: api.vyla.cc
|
||||
```
|
||||
|
||||
#### Path Parameters
|
||||
| Parameter | Type | Required | Description |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
| `id` | `integer` | Required | Numeric TMDB TV Series ID (e.g. `1396`) |
|
||||
| `season` | `integer` | Required | Season number (e.g. `1`) |
|
||||
| `episode` | `integer` | Required | Episode number (e.g. `1`) |
|
||||
**Parameters:**
|
||||
- `id` *(number, required)* — TMDB Series ID (e.g. `1396`).
|
||||
- `season` *(number, required)* — Season number (e.g. `1`).
|
||||
- `episode` *(number, required)* — Episode number (e.g. `1`).
|
||||
|
||||
#### Example Request
|
||||
```bash
|
||||
curl https://your-api.example.com/subtitles/tv/1396/1/1
|
||||
curl https://api.vyla.cc/subtitles/tv/1396/1/1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Download Endpoints
|
||||
## Direct Download Endpoints
|
||||
|
||||
Stream API resolves high-speed direct media download packages and torrent/debrid links. Download lookups are separated from playback streams to allow offline caching or background download managers.
|
||||
Fetch direct video files and torrent/debrid download packages.
|
||||
|
||||
---
|
||||
|
||||
### 1. Movie Downloads
|
||||
### 1. Movie Downloads: `GET /downloads/movie/:id`
|
||||
|
||||
```http
|
||||
GET /downloads/movie/:id HTTP/1.1
|
||||
Host: your-api.example.com
|
||||
GET /downloads/movie/155 HTTP/1.1
|
||||
Host: api.vyla.cc
|
||||
```
|
||||
|
||||
#### Example Response
|
||||
```json
|
||||
{
|
||||
"downloads": [
|
||||
@@ -95,14 +82,14 @@ Host: your-api.example.com
|
||||
"size": 2450882194,
|
||||
"type": "mkv",
|
||||
"active": true,
|
||||
"url": "https://fast-cdn.example.com/download/the-dark-knight-1080p.mkv"
|
||||
"url": "https://cdn.example.com/download/the-dark-knight-1080p.mkv"
|
||||
},
|
||||
{
|
||||
"quality": "720p",
|
||||
"size": 1150428190,
|
||||
"type": "mkv",
|
||||
"active": true,
|
||||
"url": "https://fast-cdn.example.com/download/the-dark-knight-720p.mkv"
|
||||
"url": "https://cdn.example.com/download/the-dark-knight-720p.mkv"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -110,14 +97,13 @@ Host: your-api.example.com
|
||||
|
||||
---
|
||||
|
||||
### 2. Television Episode Downloads
|
||||
### 2. Television Episode Downloads: `GET /downloads/tv/:id/:season/:episode`
|
||||
|
||||
```http
|
||||
GET /downloads/tv/:id/:season/:episode HTTP/1.1
|
||||
Host: your-api.example.com
|
||||
GET /downloads/tv/1396/1/1 HTTP/1.1
|
||||
Host: api.vyla.cc
|
||||
```
|
||||
|
||||
#### Example Response
|
||||
```json
|
||||
{
|
||||
"downloads": [
|
||||
@@ -126,7 +112,7 @@ Host: your-api.example.com
|
||||
"size": 1420882194,
|
||||
"type": "mkv",
|
||||
"active": true,
|
||||
"url": "https://fast-cdn.example.com/download/breaking-bad-s01e01-1080p.mkv"
|
||||
"url": "https://cdn.example.com/download/breaking-bad-s01e01-1080p.mkv"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -134,8 +120,8 @@ Host: your-api.example.com
|
||||
|
||||
---
|
||||
|
||||
## Best Practices for Clients
|
||||
## Client Integration Notes
|
||||
|
||||
1. **Do Not Block Initial Playback**: Initiate subtitle and download queries asynchronously. The video player should start playback immediately on the first candidate stream, and subtitles should be attached dynamically as they arrive.
|
||||
2. **CORS Handling**: Subtitle files proxied through `/api?url=...` are served with `Access-Control-Allow-Origin: *`, ensuring HTML5 `<track>` elements load cleanly in cross-origin browser contexts.
|
||||
3. **Format Support**: While most modern players prefer `.vtt`, some tracks are returned in `.srt`. If your player strictly requires WebVTT, convert SRT timestamps (`00:01:20,500` -> `00:01:20.500`) client-side before loading.
|
||||
- **Non-blocking Loading**: Fetch subtitles in the background while video playback begins immediately on the first candidate stream.
|
||||
- **CORS Permissive**: Subtitle tracks proxied through `/api?url=...` include `Access-Control-Allow-Origin: *`, allowing HTML5 `<track>` elements to render in any browser context.
|
||||
- **Format Conversion**: If your web player requires WebVTT, convert SRT commas to dots (`00:01:20,500` -> `00:01:20.500`) client-side before loading.
|
||||
|
||||
Reference in New Issue
Block a user