homebridge-stream-triggers 1.2.0 → 1.3.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 +1 -1
- package/lib/launcher.d.ts.map +1 -1
- package/lib/launcher.js +18 -16
- package/lib/launcher.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ A static list can be set instead (mainly for testing; it disables fetching entir
|
|
|
69
69
|
| --- | --- | --- |
|
|
70
70
|
| `key` | yes | Short unique id (e.g. `destiny`). Seeds the accessory UUID, so it's stable across restarts. |
|
|
71
71
|
| `type` | yes | `youtube`, `twitch`, or `kick`. |
|
|
72
|
-
| `url` | youtube | YouTube: the channel's live page, e.g. `https://www.youtube.com/@destiny/live` (required). Kick:
|
|
72
|
+
| `url` | youtube | YouTube: the channel's live page, e.g. `https://www.youtube.com/@destiny/live` (required). Twitch/Kick: optional; when set it is tried as a deep link, falling back to opening the app if the command is rejected. |
|
|
73
73
|
| `displayName` | no | Defaults to the capitalized key. The switch is named `<displayName><suffix>` (e.g. `Destiny Trigger`). |
|
|
74
74
|
|
|
75
75
|
### Platform options
|
package/lib/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAkBxC,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAFL,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,KAAK;IAG/B,6EAA6E;IACvE,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;YAgCrC,UAAU;CAkBzB"}
|
package/lib/launcher.js
CHANGED
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* client has requested the app list once (documented pyatv FAQ behavior). Priming on
|
|
7
7
|
* every launch keeps the system self-healing across tvOS updates.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* App to open when a channel has no deep-link url, and the fallback when a
|
|
11
|
+
* deep link is rejected. Twitch's tvOS client almost certainly ignores deep
|
|
12
|
+
* links (see CLAUDE.md), so omni-notify sends twitch channels without a url;
|
|
13
|
+
* a url can be supplied to experiment.
|
|
14
|
+
*/
|
|
15
|
+
const FALLBACK_APP_IDS = { twitch: "tv.twitch", kick: "com.kick.mobile" };
|
|
10
16
|
export class StreamLauncher {
|
|
11
17
|
log;
|
|
12
18
|
atv;
|
|
@@ -31,14 +37,14 @@ export class StreamLauncher {
|
|
|
31
37
|
if (!uri)
|
|
32
38
|
return;
|
|
33
39
|
if (!(await this.atv.run(`launch_app=${uri}`, prefix))) {
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
this.log.warn(`${prefix}
|
|
39
|
-
if (!(await this.atv.run(`launch_app=${
|
|
40
|
+
// Twitch/Kick deep links are unverified on tvOS; if one is rejected,
|
|
41
|
+
// opening the app still beats doing nothing.
|
|
42
|
+
const fallbackApp = channel.type === "youtube" ? undefined : FALLBACK_APP_IDS[channel.type];
|
|
43
|
+
if (fallbackApp && uri !== fallbackApp) {
|
|
44
|
+
this.log.warn(`${prefix} Deep link rejected; opening the app instead`);
|
|
45
|
+
if (!(await this.atv.run(`launch_app=${fallbackApp}`, prefix)))
|
|
40
46
|
return;
|
|
41
|
-
this.log.info(`${prefix} Launched ${
|
|
47
|
+
this.log.info(`${prefix} Launched ${fallbackApp}`);
|
|
42
48
|
}
|
|
43
49
|
return;
|
|
44
50
|
}
|
|
@@ -49,14 +55,10 @@ export class StreamLauncher {
|
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
async resolveUri(channel, prefix) {
|
|
52
|
-
if (channel.type === "twitch") {
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (channel.type === "kick") {
|
|
57
|
-
// Try the universal link (kick.com's AASA claims https://kick.com/*);
|
|
58
|
-
// without a url, just open the app.
|
|
59
|
-
return channel.url ?? KICK_APP_ID;
|
|
58
|
+
if (channel.type === "twitch" || channel.type === "kick") {
|
|
59
|
+
// With a url, try it as a deep link (falls back to the app if rejected);
|
|
60
|
+
// without one, just open the app.
|
|
61
|
+
return channel.url ?? FALLBACK_APP_IDS[channel.type];
|
|
60
62
|
}
|
|
61
63
|
if (!channel.url) {
|
|
62
64
|
this.log.error(`${prefix} YouTube channel is missing "url"`);
|
package/lib/launcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,E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,CAAC,IAAI,CAAC,GAAG,MAAM,mBAAmB,OAAO,EAAE,CAAC,CAAC;QACrD,OAAO,qCAAqC,OAAO,EAAE,CAAC;IACxD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-stream-triggers",
|
|
3
3
|
"displayName": "Homebridge Stream Triggers",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"description": "HomeKit switches that launch live streams (YouTube/Twitch) on an Apple TV via atvremote and yt-dlp.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"homebridge-plugin",
|