@gibme/tablo.tv 20.0.1 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -47
- package/dist/lighthouse.d.ts +1 -2
- package/dist/lighthouse.js +151 -200
- package/dist/lighthouse.js.map +1 -1
- package/dist/live_transcoder.d.ts +5 -0
- package/dist/live_transcoder.js +114 -91
- package/dist/live_transcoder.js.map +1 -1
- package/dist/tablo.d.ts +2 -2
- package/dist/tablo.js +285 -295
- package/dist/tablo.js.map +1 -1
- package/dist/tablo_api.d.ts +0 -1
- package/dist/tablo_api.js +52 -75
- package/dist/tablo_api.js.map +1 -1
- package/package.json +25 -24
package/README.md
CHANGED
|
@@ -1,58 +1,171 @@
|
|
|
1
1
|
# Tablo TV API Tooling
|
|
2
2
|
|
|
3
|
-
This package is not affiliated with or acting on behalf of Tablo TV
|
|
3
|
+
This package is not affiliated with or acting on behalf of Tablo TV.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
7
7
|
[https://gibme-npm.github.io/tablo.tv](https://gibme-npm.github.io/tablo.tv)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Requirements
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
- Node.js >= 22
|
|
12
|
+
- FFmpeg (for live transcoding features)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
yarn add @gibme/tablo.tv
|
|
18
|
+
# or
|
|
19
|
+
npm install @gibme/tablo.tv
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import Tablo, { Lighthouse, LiveTranscoder } from '@gibme/tablo.tv';
|
|
26
|
+
|
|
27
|
+
// Discover devices on the local network
|
|
28
|
+
const devices = await Tablo.discover();
|
|
29
|
+
|
|
30
|
+
// Connect to a device (requires access/secret keys)
|
|
31
|
+
const tablo = new Tablo(devices[0].url, {
|
|
32
|
+
access_key: 'your-access-key',
|
|
33
|
+
secret_key: 'your-secret-key'
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const info = await tablo.info();
|
|
37
|
+
console.log(`Connected to: ${info?.name} (v${info?.version})`);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Note:** The access key and secret key required to interact with a Tablo device are not included in this repository but are required to use the Device API.
|
|
12
41
|
|
|
13
42
|
## Features
|
|
14
43
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
### Lighthouse API (Cloud)
|
|
45
|
+
|
|
46
|
+
Static methods for unauthenticated device discovery and instance methods for authenticated account/guide operations. Handles OAuth token management with automatic retry on 401.
|
|
47
|
+
|
|
48
|
+
**Static Methods (no authentication required):**
|
|
49
|
+
|
|
50
|
+
| Method | Description |
|
|
51
|
+
|--------|-------------|
|
|
52
|
+
| `Lighthouse.listAvailableDevices()` | Discover Tablo devices on the network |
|
|
53
|
+
| `Lighthouse.listVirtualDevices()` | List virtual/cloud devices |
|
|
54
|
+
| `Lighthouse.virtualDevice(serverId)` | Get a specific virtual device |
|
|
55
|
+
|
|
56
|
+
**Instance Methods (requires email/password):**
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
const lighthouse = new Lighthouse('email@example.com', 'password');
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
| Method | Description |
|
|
63
|
+
|--------|-------------|
|
|
64
|
+
| `accountInfo()` | Retrieve account information and profiles |
|
|
65
|
+
| `devices()` | List devices associated with the account |
|
|
66
|
+
| `resolveDevice(serverId)` | Get device details by server ID |
|
|
67
|
+
| `selectDeviceContext(profileId, serverId)` | Set device context for guide operations |
|
|
68
|
+
| `guideChannels(contextToken)` | List available guide channels |
|
|
69
|
+
| `currentLiveAirings(contextToken)` | List currently airing live programs |
|
|
70
|
+
| `channelAirings(channelId, contextToken)` | Get airings for a specific channel |
|
|
71
|
+
|
|
72
|
+
### Device API
|
|
73
|
+
|
|
74
|
+
Local device interaction using HMAC-MD5 signed requests. Provides access to device settings, channels, tuners, storage, airings, and watch sessions.
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const tablo = new Tablo('http://192.168.1.100:8887', {
|
|
78
|
+
access_key: 'your-access-key',
|
|
79
|
+
secret_key: 'your-secret-key'
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**General:**
|
|
84
|
+
|
|
85
|
+
| Method | Description |
|
|
86
|
+
|--------|-------------|
|
|
87
|
+
| `info()` | Device information (name, model, version, etc.) |
|
|
88
|
+
| `settings()` | Device settings (LED, recording preferences, etc.) |
|
|
89
|
+
| `storage()` | Supported storage types |
|
|
90
|
+
| `tuners()` | Tuner status (in-use, current channel, recording) |
|
|
91
|
+
| `hardDrives()` | Connected hard drive info (size, usage, format state) |
|
|
92
|
+
| `location()` | Device location and timezone |
|
|
93
|
+
| `deviceSubscription()` | Device subscription state |
|
|
94
|
+
| `accountSubscription()` | Account subscription and service details |
|
|
95
|
+
| `capabilities()` | Device capability list |
|
|
96
|
+
|
|
97
|
+
**Channels & Guide:**
|
|
98
|
+
|
|
99
|
+
| Method | Description |
|
|
100
|
+
|--------|-------------|
|
|
101
|
+
| `channels()` | List all available channels |
|
|
102
|
+
| `channel(channelId)` | Get a single channel by identifier |
|
|
103
|
+
| `channelScanInfo(scanIdx?)` | Channel scan information |
|
|
104
|
+
| `guideStatus()` | Guide data status and last update |
|
|
105
|
+
| `airings(all?, timeout?, forceRefresh?, progressCallback?)` | Get airings (cached with 10-min TTL) |
|
|
106
|
+
|
|
107
|
+
**Updates:**
|
|
108
|
+
|
|
109
|
+
| Method | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `updateInfo()` | Device firmware update information |
|
|
112
|
+
| `updateProgress()` | Current update progress |
|
|
113
|
+
|
|
114
|
+
**Watch Sessions:**
|
|
115
|
+
|
|
116
|
+
| Method | Description |
|
|
117
|
+
|--------|-------------|
|
|
118
|
+
| `watchChannel(channelId, deviceInfo?)` | Start a live watch session |
|
|
119
|
+
| `session(tokenOrSession)` | Retrieve an existing session |
|
|
120
|
+
| `keepaliveSession(tokenOrSession)` | Send keepalive to prevent timeout |
|
|
121
|
+
| `deleteSession(tokenOrSession)` | Stop a watch session |
|
|
122
|
+
|
|
123
|
+
### Live Transcoder
|
|
124
|
+
|
|
125
|
+
FFmpeg-based MPEG2 to H.264 transcoding with HLS output. Uses a singleton pattern per device/channel combination and supports multiple concurrent consumers via reference counting.
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// Create a transcoder instance (singleton per device + channel)
|
|
129
|
+
const transcoder = await LiveTranscoder.instance(tablo, channelId, './streams');
|
|
130
|
+
|
|
131
|
+
transcoder.on('ready', () => {
|
|
132
|
+
console.log(`Stream available at: ${transcoder.full_path}`);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
transcoder.on('error', (error) => {
|
|
136
|
+
console.error('Transcoder error:', error.message);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
transcoder.on('stopped', () => {
|
|
140
|
+
console.log('Transcoder stopped');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// Start transcoding
|
|
144
|
+
await transcoder.start();
|
|
145
|
+
|
|
146
|
+
// Stop when done (decrements use count; only stops FFmpeg when no consumers remain)
|
|
147
|
+
transcoder.stop();
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**Events:**
|
|
151
|
+
|
|
152
|
+
| Event | Payload | Description |
|
|
153
|
+
|-------|---------|-------------|
|
|
154
|
+
| `ready` | — | HLS output file is ready for streaming |
|
|
155
|
+
| `error` | `Error` | FFmpeg or session error occurred |
|
|
156
|
+
| `exit` | `number \| null` | FFmpeg process exited |
|
|
157
|
+
| `stopped` | — | Transcoder fully stopped and cleaned up |
|
|
158
|
+
|
|
159
|
+
**Properties:**
|
|
160
|
+
|
|
161
|
+
| Property | Type | Description |
|
|
162
|
+
|----------|------|-------------|
|
|
163
|
+
| `active` | `boolean` | Whether the transcoder is running |
|
|
164
|
+
| `use_count` | `number` | Number of concurrent consumers |
|
|
165
|
+
| `full_path` | `string` | Full path to the HLS playlist |
|
|
166
|
+
| `session` | `PlayerSession?` | Current streaming session |
|
|
167
|
+
| `channel` | `Channel?` | Current channel being transcoded |
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|
package/dist/lighthouse.d.ts
CHANGED
|
@@ -3,11 +3,10 @@ export declare class Lighthouse {
|
|
|
3
3
|
private readonly email;
|
|
4
4
|
private readonly password;
|
|
5
5
|
readonly timeout: number;
|
|
6
|
-
private readonly request_logging;
|
|
7
6
|
private static readonly base_uri;
|
|
8
7
|
private token?;
|
|
9
8
|
private context_token;
|
|
10
|
-
constructor(email: string, password: string, timeout?: number
|
|
9
|
+
constructor(email: string, password: string, timeout?: number);
|
|
11
10
|
get authenticated(): boolean;
|
|
12
11
|
private get base_uri();
|
|
13
12
|
static execute<ResponseType = any>(method: string, endpoint: string, params?: Record<string, any>, payload?: Record<string, any> | string, timeout?: number): Promise<ResponseType>;
|