stremiok 2.2.7 → 2.2.8
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/CHANGELOG.md +17 -0
- package/README.md +12 -5
- package/config.xml +3 -1
- package/index.html +35 -35
- package/js/iptv.js +85 -6
- package/js/player-audio.js +5 -5
- package/js/player-controls.js +4 -4
- package/js/player-core.js +171 -11
- package/js/player-quality.js +14 -8
- package/js/player-subs.js +2 -2
- package/js/stremio.js +119 -4
- package/js/stvod.js +4 -2
- package/js/util.js +9 -7
- package/js/vendor/SHAKA-LICENSE +281 -0
- package/js/vendor/shaka-player.compiled.js +1983 -0
- package/js/view-core.js +43 -2
- package/js/view-detail.js +15 -1
- package/js/view-settings.js +58 -25
- package/js/ytplay.js +30 -3
- package/package.json +1 -1
- package/service/index.js +139 -23
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
What changed in each version of StremioK, newest first. How everything works is in the
|
|
4
4
|
[user guide](docs/USER-GUIDE.md).
|
|
5
5
|
|
|
6
|
+
## 2.2.8 — 2026-11-04
|
|
7
|
+
- **DRM channels** (a playlist's `#KODIPROP` lines): Widevine and PlayReady play in the TV's player
|
|
8
|
+
with the license server the playlist names; ClearKey with its keys or key server, through Shaka
|
|
9
|
+
Player (included, and used only for those). Only with streams you're entitled to: see the
|
|
10
|
+
README's legal note (#11).
|
|
11
|
+
- **Films in a playlist** behind a DASH or HLS link can be scrubbed through, as their manifest says
|
|
12
|
+
they're films, not live channels (#11).
|
|
13
|
+
- **Export configuration** (Settings › Content): your addons, playlists, Stalker portals, API keys and
|
|
14
|
+
settings as a file for your phone, to bring everything back after a reinstall. *Import
|
|
15
|
+
configuration file* takes it from your phone: its link, the file itself, or pasted (#12).
|
|
16
|
+
- **A stream's Cookie** (from a playlist or an addon) is sent with it, for providers whose servers
|
|
17
|
+
need one.
|
|
18
|
+
- **Stalker films and series:** a row, category or search shown again within 10 minutes isn't read
|
|
19
|
+
from the portal again.
|
|
20
|
+
- **Anime series from other addons:** a show whose card or row calls it a film, *anime* or *other*
|
|
21
|
+
opens on its seasons and episodes when its details say it's a series, not on sources.
|
|
22
|
+
|
|
6
23
|
## 2.2.7 — 2026-11-03
|
|
7
24
|
- **A Stalker portal's films and series:** in the Movies and Series tabs, Discover by the
|
|
8
25
|
portal's categories, and Search; on titles from your addons, the portal's copy is a source
|
package/README.md
CHANGED
|
@@ -73,11 +73,8 @@ metadata come from the addons you install (**Cinemeta**, the official one, by de
|
|
|
73
73
|
playable sources come from whatever **stream addons you add yourself** in Settings. Streams
|
|
74
74
|
that only expose a torrent `infoHash` play only through a streaming server you run (Stremio's
|
|
75
75
|
or TorrServer): this app embeds no torrent or debrid engine.
|
|
76
|
-
> **Note on WatchHub:** StremioK doesn't install it
|
|
77
|
-
> Stremio authorizes in writing
|
|
78
|
-
> instead (with a TMDB key). You can still add it yourself as a third-party addon (Settings
|
|
79
|
-
> shows that notice on it); its results are rent/buy/subscription *links to external
|
|
80
|
-
> services*, not video URLs. Add stream addons that return HTTP/HLS URLs for actual playback.
|
|
76
|
+
> **Note on WatchHub:** StremioK doesn't install it: its answers say it's only for clients
|
|
77
|
+
> Stremio authorizes in writing. "Where to watch" comes from TMDB instead (with a TMDB key).
|
|
81
78
|
|
|
82
79
|
The **IPTV** feature likewise hosts no content: you supply your own M3U playlist URLs, Xtream
|
|
83
80
|
accounts or Stalker portals. For YouTube entries, the bundled service finds the video's stream; the video itself
|
|
@@ -86,6 +83,12 @@ source, unless you download it to your own USB drive. What StremioK does keep, o
|
|
|
86
83
|
your progress, settings and copies that let it start faster (see
|
|
87
84
|
[Privacy and data](docs/PRIVACY.md#what-stays-on-the-tv)).
|
|
88
85
|
|
|
86
|
+
**DRM:** StremioK doesn't break or bypass copy protection. A protected channel plays only with
|
|
87
|
+
the license server or keys its playlist gives (Widevine and PlayReady through the TV's player,
|
|
88
|
+
ClearKey through Shaka Player), as in Kodi and other players. StremioK can't tell where a
|
|
89
|
+
playlist's keys come from: use only streams and keys you're entitled to; what you add is your
|
|
90
|
+
responsibility.
|
|
91
|
+
|
|
89
92
|
## Known limitations
|
|
90
93
|
|
|
91
94
|
- AVPlay behavior varies by TV generation, codec and HLS provider.
|
|
@@ -110,6 +113,10 @@ your progress, settings and copies that let it start faster (see
|
|
|
110
113
|
|
|
111
114
|
MIT: see [LICENSE](LICENSE).
|
|
112
115
|
|
|
116
|
+
It includes [Shaka Player](https://github.com/shaka-project/shaka-player) 5.3.3 (© Google LLC,
|
|
117
|
+
Apache License 2.0: [js/vendor/SHAKA-LICENSE](js/vendor/SHAKA-LICENSE)), loaded only to play
|
|
118
|
+
ClearKey channels.
|
|
119
|
+
|
|
113
120
|
Skip timestamps come partly from [SkipDB](https://skipdb.tv), whose data is published under
|
|
114
121
|
the [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/) (see its
|
|
115
122
|
[DATA-LICENSE](https://github.com/SkipDB-TV/skipdb/blob/main/DATA-LICENSE)). StremioK only
|
package/config.xml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
|
|
3
|
-
id="http://stremiok.tizen/StremioKTizen" version="2.2.
|
|
3
|
+
id="http://stremiok.tizen/StremioKTizen" version="2.2.8" viewmodes="maximized">
|
|
4
4
|
<tizen:application id="StremioK01.StremioK" package="StremioK01" required_version="3.0"/>
|
|
5
5
|
<content src="index.html"/>
|
|
6
6
|
<feature name="http://tizen.org/feature/screen.size.all"/>
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
|
|
13
13
|
<tizen:privilege name="http://tizen.org/privilege/application.launch"/>
|
|
14
14
|
<tizen:privilege name="http://developer.samsung.com/privilege/network.public"/>
|
|
15
|
+
<!-- DRM channels (Widevine, PlayReady) through the TV's player: see js/player-core.js, drmSetup -->
|
|
16
|
+
<tizen:privilege name="http://developer.samsung.com/privilege/drmplay"/>
|
|
15
17
|
<!-- Local media probe: reading USB drives -->
|
|
16
18
|
<tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>
|
|
17
19
|
<!-- Cross-origin XHR to any addon host, and to the local YouTube service -->
|
package/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=1920, height=1080, user-scalable=no">
|
|
6
6
|
<title>StremioK</title>
|
|
7
|
-
<link rel="stylesheet" href="css/style.css?v=2.2.
|
|
7
|
+
<link rel="stylesheet" href="css/style.css?v=2.2.8">
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<!-- CSS-applied sentinel (kept off-screen); app.js waits for its width before rendering -->
|
|
@@ -53,39 +53,39 @@
|
|
|
53
53
|
|
|
54
54
|
<!-- Load order matters: polyfills -> util -> iptv -> data -> input -> tvapps -> player parts -> player -> ytplay -> view parts -> views -> app -->
|
|
55
55
|
<!-- ?v= busts the TV webview cache on every release (keep in sync with package.json) -->
|
|
56
|
-
<script src="js/polyfills.js?v=2.2.
|
|
57
|
-
<script src="js/util.js?v=2.2.
|
|
58
|
-
<script src="js/iptv.js?v=2.2.
|
|
59
|
-
<script src="js/xtvod.js?v=2.2.
|
|
60
|
-
<script src="js/stvod.js?v=2.2.
|
|
61
|
-
<script src="js/epg.js?v=2.2.
|
|
62
|
-
<script src="js/youtube.js?v=2.2.
|
|
63
|
-
<script src="js/stremio.js?v=2.2.
|
|
64
|
-
<script src="js/trakt.js?v=2.2.
|
|
65
|
-
<script src="js/keys.js?v=2.2.
|
|
66
|
-
<script src="js/focus.js?v=2.2.
|
|
67
|
-
<script src="js/tvapps.js?v=2.2.
|
|
68
|
-
<script src="js/player-core.js?v=2.2.
|
|
69
|
-
<script src="js/player-store.js?v=2.2.
|
|
70
|
-
<script src="js/player-lang.js?v=2.2.
|
|
71
|
-
<script src="js/player-quality.js?v=2.2.
|
|
72
|
-
<script src="js/player-subs.js?v=2.2.
|
|
73
|
-
<script src="js/player-audio.js?v=2.2.
|
|
74
|
-
<script src="js/player-controls.js?v=2.2.
|
|
75
|
-
<script src="js/player.js?v=2.2.
|
|
76
|
-
<script src="js/ytplay.js?v=2.2.
|
|
77
|
-
<script src="js/local.js?v=2.2.
|
|
78
|
-
<script src="js/downloads.js?v=2.2.
|
|
79
|
-
<script src="js/stremio-account.js?v=2.2.
|
|
80
|
-
<script src="js/view-core.js?v=2.2.
|
|
81
|
-
<script src="js/view-home.js?v=2.2.
|
|
82
|
-
<script src="js/view-guide.js?v=2.2.
|
|
83
|
-
<script src="js/view-detail.js?v=2.2.
|
|
84
|
-
<script src="js/view-search.js?v=2.2.
|
|
85
|
-
<script src="js/view-settings.js?v=2.2.
|
|
86
|
-
<script src="js/view-discover.js?v=2.2.
|
|
87
|
-
<script src="js/views.js?v=2.2.
|
|
88
|
-
<script src="js/app.js?v=2.2.
|
|
89
|
-
<script src="js/hubpreview.js?v=2.2.
|
|
56
|
+
<script src="js/polyfills.js?v=2.2.8"></script>
|
|
57
|
+
<script src="js/util.js?v=2.2.8"></script>
|
|
58
|
+
<script src="js/iptv.js?v=2.2.8"></script>
|
|
59
|
+
<script src="js/xtvod.js?v=2.2.8"></script>
|
|
60
|
+
<script src="js/stvod.js?v=2.2.8"></script>
|
|
61
|
+
<script src="js/epg.js?v=2.2.8"></script>
|
|
62
|
+
<script src="js/youtube.js?v=2.2.8"></script>
|
|
63
|
+
<script src="js/stremio.js?v=2.2.8"></script>
|
|
64
|
+
<script src="js/trakt.js?v=2.2.8"></script>
|
|
65
|
+
<script src="js/keys.js?v=2.2.8"></script>
|
|
66
|
+
<script src="js/focus.js?v=2.2.8"></script>
|
|
67
|
+
<script src="js/tvapps.js?v=2.2.8"></script>
|
|
68
|
+
<script src="js/player-core.js?v=2.2.8"></script>
|
|
69
|
+
<script src="js/player-store.js?v=2.2.8"></script>
|
|
70
|
+
<script src="js/player-lang.js?v=2.2.8"></script>
|
|
71
|
+
<script src="js/player-quality.js?v=2.2.8"></script>
|
|
72
|
+
<script src="js/player-subs.js?v=2.2.8"></script>
|
|
73
|
+
<script src="js/player-audio.js?v=2.2.8"></script>
|
|
74
|
+
<script src="js/player-controls.js?v=2.2.8"></script>
|
|
75
|
+
<script src="js/player.js?v=2.2.8"></script>
|
|
76
|
+
<script src="js/ytplay.js?v=2.2.8"></script>
|
|
77
|
+
<script src="js/local.js?v=2.2.8"></script>
|
|
78
|
+
<script src="js/downloads.js?v=2.2.8"></script>
|
|
79
|
+
<script src="js/stremio-account.js?v=2.2.8"></script>
|
|
80
|
+
<script src="js/view-core.js?v=2.2.8"></script>
|
|
81
|
+
<script src="js/view-home.js?v=2.2.8"></script>
|
|
82
|
+
<script src="js/view-guide.js?v=2.2.8"></script>
|
|
83
|
+
<script src="js/view-detail.js?v=2.2.8"></script>
|
|
84
|
+
<script src="js/view-search.js?v=2.2.8"></script>
|
|
85
|
+
<script src="js/view-settings.js?v=2.2.8"></script>
|
|
86
|
+
<script src="js/view-discover.js?v=2.2.8"></script>
|
|
87
|
+
<script src="js/views.js?v=2.2.8"></script>
|
|
88
|
+
<script src="js/app.js?v=2.2.8"></script>
|
|
89
|
+
<script src="js/hubpreview.js?v=2.2.8"></script>
|
|
90
90
|
</body>
|
|
91
91
|
</html>
|
package/js/iptv.js
CHANGED
|
@@ -304,13 +304,84 @@ var IPTV = (function () {
|
|
|
304
304
|
function idOf(s, exact) { return slug(s) + '-' + hash(exact === undefined ? s : exact); }
|
|
305
305
|
|
|
306
306
|
function attr(line, re) { var m = line.match(re); return m ? m[1] : ''; }
|
|
307
|
-
// A header a playlist gives a channel, by name: its User-Agent or
|
|
307
|
+
// A header a playlist gives a channel, by name: its User-Agent, Referer or Cookie (the ones the
|
|
308
308
|
// TV's player takes: any other is left out). Checked when played (U.sanitizeHeaders).
|
|
309
309
|
function headerInto(c, name, value) {
|
|
310
310
|
var n = ('' + name).trim().toLowerCase(), v = ('' + (value || '')).trim();
|
|
311
311
|
if (!v) { return; }
|
|
312
|
-
if (n === 'user-agent') { c.ua = v; } else if (n === 'referer' || n === 'referrer') { c.ref = v; }
|
|
312
|
+
if (n === 'user-agent') { c.ua = v; } else if (n === 'referer' || n === 'referrer') { c.ref = v; } else if (n === 'cookie') { c.cookie = v; }
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// A channel's DRM, from Kodi's #KODIPROP:inputstream.adaptive.<key>=<value> lines: { sys:
|
|
316
|
+
// 'widevine' | 'playready' | 'clearkey' | 'other', url: its license server, h: { name: value }
|
|
317
|
+
// for the license request, b64: its answer comes in base64, bad: a request or answer template
|
|
318
|
+
// StremioK can't follow, keys: ClearKey's { kid: key } (hex) when the playlist gives them }.
|
|
319
|
+
// Widevine or PlayReady with a license server: the TV's player (drmPlayable); ClearKey with keys
|
|
320
|
+
// or a key server: Shaka Player (drmShaka, see the player's startShaka). stream_headers /
|
|
321
|
+
// manifest_headers: the stream's own User-Agent and Referer.
|
|
322
|
+
function drmSys(v) { v = ('' + v).toLowerCase(); return /widevine/.test(v) ? 'widevine' : /playready/.test(v) ? 'playready' : /clearkey/.test(v) ? 'clearkey' : 'other'; }
|
|
323
|
+
function headersOf(text) { // "Name=value&Name2=value2" (values may be %-encoded) -> { Name: value }
|
|
324
|
+
var out = {}, n = 0;
|
|
325
|
+
('' + (text || '')).split('&').forEach(function (kv) {
|
|
326
|
+
var eq = kv.indexOf('='), k = eq > 0 ? kv.slice(0, eq).trim() : '', v = eq > 0 ? kv.slice(eq + 1) : '';
|
|
327
|
+
try { v = decodeURIComponent(v); } catch (e) {}
|
|
328
|
+
if (/^[A-Za-z0-9-]{1,40}$/.test(k) && v && v.length <= 1000 && !/[\r\n]/.test(v) && n < 16) { out[k] = v; n++; }
|
|
329
|
+
});
|
|
330
|
+
return out;
|
|
331
|
+
}
|
|
332
|
+
function hexOf(v) { // a key id or key: hex (32 digits), or base64url (a JWK's)
|
|
333
|
+
v = ('' + (v || '')).trim();
|
|
334
|
+
if (/^[0-9a-f]{32}$/i.test(v)) { return v.toLowerCase(); }
|
|
335
|
+
if (!/^[A-Za-z0-9_-]{21,24}={0,2}$/.test(v)) { return ''; }
|
|
336
|
+
try {
|
|
337
|
+
var bin = atob(v.replace(/-/g, '+').replace(/_/g, '/').replace(/=+$/, '') + '=='.slice(0, (4 - v.replace(/=+$/, '').length % 4) % 4)), out = '';
|
|
338
|
+
for (var i = 0; i < bin.length; i++) { out += (bin.charCodeAt(i) < 16 ? '0' : '') + bin.charCodeAt(i).toString(16); }
|
|
339
|
+
return out.length === 32 ? out : '';
|
|
340
|
+
} catch (e) { return ''; }
|
|
341
|
+
}
|
|
342
|
+
// ClearKey's keys as a playlist gives them: kid:key[,kid:key], { "kid": "key" }, or a JWK set
|
|
343
|
+
// { "keys": [{ "kid", "k" }] } -> { kid: key } in hex, or null.
|
|
344
|
+
function keysOf(text) {
|
|
345
|
+
var out = {}, n = 0, j = null;
|
|
346
|
+
function put(kid, key) { kid = hexOf(kid); key = hexOf(key); if (kid && key && n < 32) { out[kid] = key; n++; } }
|
|
347
|
+
text = ('' + (text || '')).trim();
|
|
348
|
+
if (text.charAt(0) === '{') {
|
|
349
|
+
try { j = JSON.parse(text); } catch (e) { j = null; }
|
|
350
|
+
if (j && Array.isArray(j.keys)) { j.keys.forEach(function (k) { if (k) { put(k.kid, k.k); } }); }
|
|
351
|
+
else if (j && typeof j === 'object') { Object.keys(j).forEach(function (k) { put(k, j[k]); }); }
|
|
352
|
+
} else {
|
|
353
|
+
text.split(',').forEach(function (pair) { var p = pair.split(':'); if (p.length === 2) { put(p[0], p[1]); } });
|
|
354
|
+
}
|
|
355
|
+
return n ? out : null;
|
|
356
|
+
}
|
|
357
|
+
function drmServer(d, url, headers) {
|
|
358
|
+
if (/^https?:\/\/[^\s|]+$/i.test(url || '') && url.length <= 2000) { d.url = url; }
|
|
359
|
+
else if (url) { d.inline = true; d.keys = keysOf(url); } // (ClearKey's kid:key, or keys as JSON)
|
|
360
|
+
if (headers) { d.h = headersOf(headers); }
|
|
361
|
+
}
|
|
362
|
+
function drmInto(c, key, v) {
|
|
363
|
+
if (key === 'stream_headers' || key === 'manifest_headers') { var sh = headersOf(v); Object.keys(sh).forEach(function (k) { headerInto(c, k, sh[k]); }); return; }
|
|
364
|
+
var d = c.drm || (c.drm = { sys: '' });
|
|
365
|
+
if (key === 'license_type') { d.sys = drmSys(v); return; }
|
|
366
|
+
if (key === 'license_key') { // URL|headers|request template|answer template
|
|
367
|
+
var p = v.split('|');
|
|
368
|
+
drmServer(d, p[0], p[1]);
|
|
369
|
+
if (p[2] && p[2] !== 'R{SSM}') { d.bad = true; }
|
|
370
|
+
if (p[3] === 'B') { d.b64 = true; } else if (p[3]) { d.bad = true; }
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
if (key === 'drm_legacy') { var q = v.split('|'); d.sys = drmSys(q[0]); drmServer(d, q[1], q[2]); return; }
|
|
374
|
+
if (key === 'drm') { // {"com.widevine.alpha": {"license": {"server_url": …, "req_headers": "Name=value&…"}}}
|
|
375
|
+
var j = null;
|
|
376
|
+
try { j = JSON.parse(v); } catch (e) { j = null; }
|
|
377
|
+
var sys = j && typeof j === 'object' ? Object.keys(j)[0] : '', lic = sys && j[sys] && j[sys].license;
|
|
378
|
+
d.sys = sys ? drmSys(sys) : 'other';
|
|
379
|
+
if (lic && typeof lic === 'object') { drmServer(d, typeof lic.server_url === 'string' ? lic.server_url : '', typeof lic.req_headers === 'string' ? lic.req_headers : ''); }
|
|
380
|
+
if (lic && (lic.keyids || lic.keys)) { d.inline = true; d.keys = keysOf(JSON.stringify(lic.keyids || { keys: lic.keys })); }
|
|
381
|
+
}
|
|
313
382
|
}
|
|
383
|
+
function drmPlayable(d) { return !!d && (d.sys === 'widevine' || d.sys === 'playready') && !!d.url && !d.bad && !d.inline; }
|
|
384
|
+
function drmShaka(d) { return !!d && d.sys === 'clearkey' && !d.bad && (!!d.keys || (!!d.url && !d.inline)); }
|
|
314
385
|
|
|
315
386
|
// A link to a file, not a stream: a film or an episode (an Xtream account's /movie/… and
|
|
316
387
|
// /series/… links, or a video file's name), played as one (seeking; see Player's isLive).
|
|
@@ -327,7 +398,7 @@ var IPTV = (function () {
|
|
|
327
398
|
// parseM3UAsync). max: channels kept; any beyond are only counted (dropped). guides: the TV
|
|
328
399
|
// guides it names (url-tvg / x-tvg-url / tvg-url, several split by commas).
|
|
329
400
|
function m3uReader(max) {
|
|
330
|
-
var r = { channels: [], dropped: 0, title: '', guides: [] }, cur = null, seen = {};
|
|
401
|
+
var r = { channels: [], dropped: 0, title: '', guides: [] }, cur = null, seen = {}, pre = null; // (pre: #KODIPROP lines before a channel's #EXTINF)
|
|
331
402
|
function add(c) {
|
|
332
403
|
var base = 'iptv:' + idOf(c.tvgId || c.name);
|
|
333
404
|
var id = base, n = 2;
|
|
@@ -360,6 +431,7 @@ var IPTV = (function () {
|
|
|
360
431
|
sport: /^sports?$/i.test(kind), // (StremioK's own mark: the Sports tab)
|
|
361
432
|
url: ''
|
|
362
433
|
};
|
|
434
|
+
if (pre) { if (pre.drm) { cur.drm = pre.drm; } if (!cur.ua && pre.ua) { cur.ua = pre.ua; } if (!cur.ref && pre.ref) { cur.ref = pre.ref; } if (!cur.cookie && pre.cookie) { cur.cookie = pre.cookie; } pre = null; }
|
|
363
435
|
if (/^guide$/i.test(kind)) { // (StremioK's own mark: a channel watched elsewhere, kept for its TV guide alone; a link after it is ignored)
|
|
364
436
|
if (max && r.channels.length >= max) { r.dropped++; cur = null; return; }
|
|
365
437
|
cur.guideOnly = true; cur.radio = false; cur.type = 'tv';
|
|
@@ -369,6 +441,9 @@ var IPTV = (function () {
|
|
|
369
441
|
}
|
|
370
442
|
} else if (/^#EXTVLCOPT:http-(user-agent|referr?er)=/i.test(s)) { // (http-referer: the one-r spelling too)
|
|
371
443
|
if (cur) { var opt = /^#EXTVLCOPT:http-(user-agent|referr?er)=(.*)$/i.exec(s); headerInto(cur, opt[1], opt[2]); }
|
|
444
|
+
} else if (/^#KODIPROP:inputstream\.adaptive\.[a-z_]+=/i.test(s)) { // a channel's DRM (Kodi's: see drmInto)
|
|
445
|
+
var kp = /^#KODIPROP:inputstream\.adaptive\.([a-z_]+)=(.*)$/i.exec(s);
|
|
446
|
+
drmInto(cur || (pre = pre || {}), kp[1].toLowerCase(), kp[2].trim());
|
|
372
447
|
} else if (s.indexOf('#EXTHTTP:') === 0) { // #EXTHTTP:{"User-Agent": "…", "Referer": "…"}
|
|
373
448
|
var j = null;
|
|
374
449
|
try { j = JSON.parse(s.slice(9)); } catch (e) { j = null; }
|
|
@@ -625,7 +700,7 @@ var IPTV = (function () {
|
|
|
625
700
|
|
|
626
701
|
function sameKey(c) {
|
|
627
702
|
var p = U.parseUrl(c.url); // (scheme and host in lower case)
|
|
628
|
-
return [p ? p.href : c.url, c.name, c.group, c.type, c.ua || '', c.ref || ''].join('\u0001');
|
|
703
|
+
return [p ? p.href : c.url, c.name, c.group, c.type, c.ua || '', c.ref || '', c.cookie || ''].join('\u0001');
|
|
629
704
|
}
|
|
630
705
|
|
|
631
706
|
function reload(id) { // (its TV guide read again too: EPG.start)
|
|
@@ -732,7 +807,11 @@ var IPTV = (function () {
|
|
|
732
807
|
var from = sourceOf(c);
|
|
733
808
|
var st = { url: c.url, name: c.name, title: 'IPTV · ' + c.group + (from ? ' · ' + from : '') };
|
|
734
809
|
if (c.vod) { st._vod = true; }
|
|
735
|
-
|
|
810
|
+
if (c.drm) { // (see the player's drmSetup and startShaka)
|
|
811
|
+
st._drm = { sys: c.drm.sys || 'other', url: c.drm.url || '', h: c.drm.h || {}, b64: !!c.drm.b64, ok: drmPlayable(c.drm), shaka: drmShaka(c.drm) };
|
|
812
|
+
if (c.drm.keys) { st._drm.keys = c.drm.keys; }
|
|
813
|
+
}
|
|
814
|
+
var h = U.sanitizeHeaders({ ua: c.ua, ref: c.ref, cookie: c.cookie }); // (only what the player takes, checked)
|
|
736
815
|
if (h) { st._headers = h; }
|
|
737
816
|
return [st];
|
|
738
817
|
}
|
|
@@ -750,7 +829,7 @@ var IPTV = (function () {
|
|
|
750
829
|
if (!url && /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\//i.test(c.url)) { return []; }
|
|
751
830
|
var st = plainStreams(c)[0];
|
|
752
831
|
st.url = url || c.url;
|
|
753
|
-
var h = U.sanitizeHeaders({ ua: STB_UA, ref: c.ref });
|
|
832
|
+
var h = U.sanitizeHeaders({ ua: STB_UA, ref: c.ref, cookie: c.cookie });
|
|
754
833
|
if (h) { st._headers = h; }
|
|
755
834
|
return [st];
|
|
756
835
|
});
|
package/js/player-audio.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(function (P) {
|
|
5
5
|
'use strict';
|
|
6
6
|
var S = P.S;
|
|
7
|
-
var avplay = P.avplay
|
|
7
|
+
var avplay = P.avplay; // (P.useAV: the TV's player's playback or the page's, as it is now: see player-core's engineFor)
|
|
8
8
|
|
|
9
9
|
// ----- from the other parts -----
|
|
10
10
|
function doAVSeek() { return P.doAVSeek.apply(null, arguments); } // core
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
// buffering. true: picked (the caller seeks). Safe: once it plays, as before. Not on
|
|
60
60
|
// live streams (nothing to seek) or YouTube videos.
|
|
61
61
|
function audioOnReady() {
|
|
62
|
-
if (!useAV || S.isLive || (S.ctx && S.ctx.yt) || getAudioCfg().switch === 'safe') { return false; }
|
|
62
|
+
if (!P.useAV || S.isLive || (S.ctx && S.ctx.yt) || getAudioCfg().switch === 'safe') { return false; }
|
|
63
63
|
var tracks = getAudioTracks();
|
|
64
64
|
_audioIdx = playingAudioIndex(tracks);
|
|
65
65
|
_audioPending = false; // (decided here: not again once it plays)
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function getAudioTracks() {
|
|
76
|
-
if (useAV) {
|
|
76
|
+
if (P.useAV) {
|
|
77
77
|
try {
|
|
78
78
|
var all = avplay.getTotalTrackInfo() || [];
|
|
79
79
|
var out = [];
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
// The audio track the player is on: AVPlay reports it (a file can flag a track
|
|
167
167
|
// other than the first as its default); otherwise assume the first track.
|
|
168
168
|
function playingAudioIndex(tracks) {
|
|
169
|
-
if (useAV) {
|
|
169
|
+
if (P.useAV) {
|
|
170
170
|
try {
|
|
171
171
|
var now = avplay.getCurrentStreamInfo() || [];
|
|
172
172
|
for (var i = 0; i < now.length; i++) {
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
// ignores re-picking the same track; stepping through a different track first makes
|
|
205
205
|
// it switch for real (the manual workaround, in one press).
|
|
206
206
|
function selectAudio(index, message, force) {
|
|
207
|
-
if (useAV) {
|
|
207
|
+
if (P.useAV) {
|
|
208
208
|
if (force) {
|
|
209
209
|
var tracks = getAudioTracks();
|
|
210
210
|
for (var k = 0; k < tracks.length; k++) {
|
package/js/player-controls.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
(function (P) {
|
|
5
5
|
'use strict';
|
|
6
6
|
var S = P.S;
|
|
7
|
-
var avplay = P.avplay
|
|
7
|
+
var avplay = P.avplay; // (P.useAV: the TV's player's playback or the page's, as it is now: see player-core's engineFor)
|
|
8
8
|
|
|
9
9
|
// ----- from the other parts -----
|
|
10
10
|
function exit() { return P.exit.apply(null, arguments); } // core
|
|
@@ -752,7 +752,7 @@
|
|
|
752
752
|
// mode this TV rejects falls back to Fit (quiet = at stream start).
|
|
753
753
|
function applyAspect(quiet) {
|
|
754
754
|
var a = aspectDef(P.aspectNow());
|
|
755
|
-
if (!useAV) { if (S.videoEl) { S.videoEl.style.objectFit = a[3]; } return true; }
|
|
755
|
+
if (!P.useAV) { if (S.videoEl) { S.videoEl.style.objectFit = a[3]; } return true; }
|
|
756
756
|
try { avplay.setDisplayMethod(a[2]); return true; } catch (e) {
|
|
757
757
|
try { avplay.setDisplayMethod(aspectDef('fit')[2]); } catch (e2) {}
|
|
758
758
|
if (!quiet) { U.toast(a[1].split(' (')[0] + ' isn\'t available on this TV', 2500); }
|
|
@@ -831,7 +831,7 @@
|
|
|
831
831
|
if (!el || !S.ctx) { return; }
|
|
832
832
|
var lines = [], video = null, audio = null;
|
|
833
833
|
sourceLines(lines);
|
|
834
|
-
if (useAV) {
|
|
834
|
+
if (P.useAV) {
|
|
835
835
|
try {
|
|
836
836
|
var now = avplay.getCurrentStreamInfo() || [];
|
|
837
837
|
for (var i = 0; i < now.length; i++) {
|
|
@@ -853,7 +853,7 @@
|
|
|
853
853
|
lines.push(['Subtitles', subtitleSummary()]);
|
|
854
854
|
if (hasQualities()) { lines.push(['Quality', qualityLabel() + ' (' + qualityCount() + ' available)']); }
|
|
855
855
|
else if (qualityUnread()) { lines.push(['Quality', 'Auto (this stream’s qualities couldn’t be read)']); }
|
|
856
|
-
if (useAV) {
|
|
856
|
+
if (P.useAV) {
|
|
857
857
|
try {
|
|
858
858
|
var bw = +avplay.getStreamingProperty('CURRENT_BANDWIDTH');
|
|
859
859
|
if (bw > 0) { lines.push(['Bandwidth', (bw / 1e6).toFixed(1) + ' Mbps']); }
|