stremiok 2.3.4 → 2.3.6
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 +19 -0
- package/README.md +14 -13
- package/config.xml +1 -1
- package/css/style.css +5 -0
- package/index.html +43 -40
- package/js/app.js +3 -3
- package/js/downloads.js +16 -16
- package/js/epg.js +2 -3
- package/js/hubpreview.js +1 -1
- package/js/i18n.js +108 -0
- package/js/iptv.js +13 -13
- package/js/jellyfin.js +19 -19
- package/js/lang/ar.js +1972 -0
- package/js/lang/de.js +1972 -0
- package/js/lang/es.js +1972 -0
- package/js/lang/fi.js +1972 -0
- package/js/lang/fr.js +1972 -0
- package/js/lang/he.js +1972 -0
- package/js/lang/hi.js +1972 -0
- package/js/lang/it.js +1972 -0
- package/js/lang/ja.js +1972 -0
- package/js/lang/ko.js +1972 -0
- package/js/lang/languages.js +21 -0
- package/js/lang/pl.js +1972 -0
- package/js/lang/pt-BR.js +1972 -0
- package/js/lang/ru.js +1972 -0
- package/js/lang/tr.js +1972 -0
- package/js/lang/zh-CN.js +1972 -0
- package/js/local.js +9 -9
- package/js/netfolders.js +13 -13
- package/js/player-audio.js +17 -17
- package/js/player-controls.js +100 -100
- package/js/player-core.js +90 -58
- package/js/player-lang.js +22 -22
- package/js/player-quality.js +15 -15
- package/js/player-store.js +13 -13
- package/js/player-subs.js +69 -69
- package/js/plex.js +11 -11
- package/js/plugins.js +270 -0
- package/js/stremio-account.js +8 -8
- package/js/stremio-sync.js +5 -5
- package/js/stremio.js +81 -78
- package/js/stvod.js +4 -4
- package/js/trakt.js +23 -23
- package/js/tvapps.js +4 -4
- package/js/util.js +48 -27
- package/js/vendor/quickjs/LICENSES.md +412 -0
- package/js/vendor/quickjs/crypto-js.js +6659 -0
- package/js/vendor/quickjs/plugin-worker-legacy.js +1364 -0
- package/js/vendor/quickjs/plugin-worker.js +8774 -0
- package/js/vendor/quickjs/quickjs.wasm +0 -0
- package/js/view-core.js +93 -93
- package/js/view-detail.js +132 -130
- package/js/view-discover.js +27 -27
- package/js/view-guide.js +13 -13
- package/js/view-home.js +124 -118
- package/js/view-search.js +25 -25
- package/js/view-settings.js +743 -643
- package/js/xtvod.js +2 -2
- package/js/youtube.js +17 -17
- package/js/ytplay.js +39 -9
- package/package.json +1 -1
- package/service/index.js +227 -13
- package/tizenbrew.html +1 -1
package/js/stremio.js
CHANGED
|
@@ -16,7 +16,7 @@ var Stremio = (function () {
|
|
|
16
16
|
];
|
|
17
17
|
// Addons whose operator limits who may use them: what Settings says about one you add.
|
|
18
18
|
var RESTRICTED = {
|
|
19
|
-
'org.stremio.watchhub': 'Third-party service: its operator says it’s only for apps Stremio authorizes in writing, and StremioK isn’t one. Use it at your own discretion.'
|
|
19
|
+
'org.stremio.watchhub': U.t('Third-party service: its operator says it’s only for apps Stremio authorizes in writing, and StremioK isn’t one. Use it at your own discretion.')
|
|
20
20
|
};
|
|
21
21
|
var RESTRICTED_HOSTS = { 'watchhub.strem.io': 'org.stremio.watchhub' };
|
|
22
22
|
// The note for an addon (its manifest id, or its URL before it has loaded), or ''.
|
|
@@ -125,7 +125,7 @@ var Stremio = (function () {
|
|
|
125
125
|
function refreshAddon(url) {
|
|
126
126
|
return fetchManifests([url]).then(function (got) {
|
|
127
127
|
var m = got[url];
|
|
128
|
-
if (!m) { throw new Error('Could not refresh '
|
|
128
|
+
if (!m) { throw new Error(U.t('Could not refresh {link}', { link: U.redactUrl(url) })); }
|
|
129
129
|
if (_loaded) { _loaded.forEach(function (a) { if (a.url === url) { a.manifest = m; } }); }
|
|
130
130
|
var kept = _loaded;
|
|
131
131
|
configChanged(); // (its sources may differ now; fetched again as titles open)
|
|
@@ -161,7 +161,8 @@ var Stremio = (function () {
|
|
|
161
161
|
function addonMs(ms) { var w = getPrefs().addonWait * 1000; return w > ms ? w : ms; }
|
|
162
162
|
function getPrefs() {
|
|
163
163
|
var p = U.store.get(PREFS_KEY, {}) || {};
|
|
164
|
-
return {
|
|
164
|
+
return { lang: typeof p.lang === 'string' && p.lang ? p.lang : 'auto', // Settings > Appearance > Language (js/i18n.js: 'auto', 'en', 'es', 'pt-BR')
|
|
165
|
+
posterShape: p.posterShape || 'portrait', accent: p.accent || 'indigo', bg: p.bg || 'dark',
|
|
165
166
|
look: p.look === 'modern' ? 'modern' : 'classic', // Settings > Appearance: Classic, or Modern (a backdrop behind Home, the title's logo, rounder posters)
|
|
166
167
|
effects: p.effects === 'light' || p.effects === 'full' ? p.effects : 'auto', // ...Modern's blur and motion: by the TV (auto), off (light) or on (full)
|
|
167
168
|
zoom: [110, 120, 130, 140].indexOf(p.zoom) !== -1 ? p.zoom : 100, // Settings > Appearance: everything bigger (percent)
|
|
@@ -210,11 +211,11 @@ var Stremio = (function () {
|
|
|
210
211
|
var bytes = (info && info.size) || sizeBytes(st);
|
|
211
212
|
if (!(bytes > 0)) { return ''; }
|
|
212
213
|
var g = bytes / 1073741824;
|
|
213
|
-
if (L.max && g > L.max) { return 'over '
|
|
214
|
-
if (L.min && g < L.min) { return 'under '
|
|
214
|
+
if (L.max && g > L.max) { return U.t('over {size}', { size: gbText(L.max) }); }
|
|
215
|
+
if (L.min && g < L.min) { return U.t('under {size}', { size: gbText(L.min) }); }
|
|
215
216
|
if (L.perHour && minutes > 0) {
|
|
216
217
|
var ph = g / (minutes / 60);
|
|
217
|
-
if (ph > L.perHour) { return (Math.round(ph * 10) / 10
|
|
218
|
+
if (ph > L.perHour) { return U.t('{size} GB an hour, over {limit}', { size: Math.round(ph * 10) / 10, limit: gbText(L.perHour) }); }
|
|
218
219
|
}
|
|
219
220
|
return '';
|
|
220
221
|
}
|
|
@@ -442,6 +443,7 @@ var Stremio = (function () {
|
|
|
442
443
|
else if (iptvOn) { iptvJoin(addons, rev); }
|
|
443
444
|
if (typeof XtVod !== 'undefined' && XtVod.isEnabled()) { addons.push(XtVod.synthAddon()); } // (your Xtream accounts' films and series: after your addons)
|
|
444
445
|
if (typeof StVod !== 'undefined' && StVod.isEnabled()) { addons.push(StVod.synthAddon()); } // (your Stalker portals' films and series)
|
|
446
|
+
if (typeof Plugins !== 'undefined' && Plugins.hasSources()) { addons.push(Plugins.synthAddon()); } // (your Nuvio plugins: a source addon)
|
|
445
447
|
if (typeof Jellyfin !== 'undefined') { Jellyfin.synthAddons().forEach(function (a) { addons.push(a); }); } // (your Jellyfin and Emby servers' libraries: one addon a kind)
|
|
446
448
|
if (typeof Plex !== 'undefined') { Plex.synthAddons().forEach(function (a) { addons.push(a); }); } // (your Plex servers')
|
|
447
449
|
if (hasYouTube()) { addons.push(YouTube.synthAddon()); } // (after your addons: its rows last on Home)
|
|
@@ -518,7 +520,7 @@ var Stremio = (function () {
|
|
|
518
520
|
function iptvRefreshEvery() { return _hasIptv && IPTV.refreshEvery ? IPTV.refreshEvery() : 0; }
|
|
519
521
|
function iptvSetRefreshEvery(h) { if (_hasIptv && IPTV.setRefreshEvery) { IPTV.setRefreshEvery(h); } }
|
|
520
522
|
function iptvReadAt() { return _hasIptv && IPTV.readAt ? IPTV.readAt() : Infinity; }
|
|
521
|
-
function iptvStatus(id) { return _hasIptv ? IPTV.status(id) : { error: 'IPTV unavailable' }; }
|
|
523
|
+
function iptvStatus(id) { return _hasIptv ? IPTV.status(id) : { error: U.t('IPTV unavailable') }; }
|
|
522
524
|
// Force a re-fetch of one playlist (Settings → Reload) and rebuild the addon list.
|
|
523
525
|
// An Xtream account turned out to have films and series, or none (XtVod.onVodChange): the IPTV
|
|
524
526
|
// rows made again from the saved copies (its film and episode lines in or out), not downloaded.
|
|
@@ -556,7 +558,7 @@ var Stremio = (function () {
|
|
|
556
558
|
// A configuration file's lines (Settings › Import configuration file), read but not yet
|
|
557
559
|
// imported: { items: [{ kind: 'addon' | 'playlist' | 'omdb' | 'tmdb' | 'mdblist', value,
|
|
558
560
|
// label, have (already yours), note }], ignored }. Blank lines and # comments skipped.
|
|
559
|
-
var KEY_NAMES = { omdb: 'OMDb key', tmdb: 'TMDB key', mdblist: 'MDBList key' };
|
|
561
|
+
var KEY_NAMES = { omdb: U.t('OMDb key'), tmdb: U.t('TMDB key'), mdblist: U.t('MDBList key') };
|
|
560
562
|
function shortLink(u) {
|
|
561
563
|
var p = U.parseUrl(u);
|
|
562
564
|
if (!p) { return ('' + u).slice(0, 60); }
|
|
@@ -583,11 +585,11 @@ var Stremio = (function () {
|
|
|
583
585
|
var lists = iptvLists(), integ = getIntegrations(), out = [], n = getAddonUrls().length;
|
|
584
586
|
var pl = lists.filter(function (p) { return !p.mac; }).length, st = lists.length - pl;
|
|
585
587
|
var keys = Object.keys(KEY_NAMES).filter(function (k) { return integ[k]; }).map(function (k) { return KEY_NAMES[k].replace(/ key$/, ''); });
|
|
586
|
-
if (n) { out.push({ key: 'addons', label:
|
|
587
|
-
if (pl) { out.push({ key: 'playlists', label:
|
|
588
|
-
if (st) { out.push({ key: 'stalker', label:
|
|
589
|
-
if (keys.length) { out.push({ key: 'keys', label: 'API keys: '
|
|
590
|
-
out.push({ key: 'settings', label: 'Your settings: look, Home, playback, subtitles, sources, streaming server, YouTube…' });
|
|
588
|
+
if (n) { out.push({ key: 'addons', label: U.tn(n, '{n} addon, in your order', '{n} addons, in your order') }); }
|
|
589
|
+
if (pl) { out.push({ key: 'playlists', label: U.tn(pl, '{n} IPTV playlist (their logins too)', '{n} IPTV playlists (their logins too)') }); }
|
|
590
|
+
if (st) { out.push({ key: 'stalker', label: U.tn(st, '{n} Stalker portal (their MAC addresses)', '{n} Stalker portals (their MAC addresses)') }); }
|
|
591
|
+
if (keys.length) { out.push({ key: 'keys', label: U.t('API keys: {keys}', { keys: keys.join(', ') }) }); }
|
|
592
|
+
out.push({ key: 'settings', label: U.t('Your settings: look, Home, playback, subtitles, sources, streaming server, YouTube…') });
|
|
591
593
|
return out;
|
|
592
594
|
}
|
|
593
595
|
function settingsValue(key) {
|
|
@@ -645,7 +647,7 @@ var Stremio = (function () {
|
|
|
645
647
|
if (m[1] === 'playlist' && typeof o.url === 'string') { details[o.url] = o; return; }
|
|
646
648
|
if (m[1] === 'stalker' && typeof o.url === 'string' && _hasIptv && IPTV.macOf && IPTV.macOf(o.mac)) {
|
|
647
649
|
var mac = IPTV.macOf(o.mac);
|
|
648
|
-
push({ kind: 'stalker', value: o.url + '|' + mac, info: o, label: 'Stalker portal · ' + (typeof o.name === 'string' && o.name ? o.name.slice(0, 60) : shortLink(o.url)),
|
|
650
|
+
push({ kind: 'stalker', value: o.url + '|' + mac, info: o, label: U.t('Stalker portal') + ' · ' + (typeof o.name === 'string' && o.name ? o.name.slice(0, 60) : shortLink(o.url)),
|
|
649
651
|
have: have.some(function (p) { return p.url === o.url && p.mac === mac; }), note: '' });
|
|
650
652
|
return;
|
|
651
653
|
}
|
|
@@ -661,21 +663,21 @@ var Stremio = (function () {
|
|
|
661
663
|
else if (/^[A-Za-z0-9]{25}$/.test(value)) { key = 'mdblist'; }
|
|
662
664
|
if (key) {
|
|
663
665
|
push({ kind: key, value: value, label: KEY_NAMES[key] + ' · …' + value.slice(-4), have: integ[key] === value,
|
|
664
|
-
note: (integ[key] && integ[key] !== value) ? 'replaces yours' : '' });
|
|
666
|
+
note: (integ[key] && integ[key] !== value) ? U.t('replaces yours') : '' });
|
|
665
667
|
} else if (U.isPlaylistUrl(U.parseUrl(value))) { // …m3u / .m3u8 (a query after it too), Xtream get.php?…type=m3u_plus
|
|
666
|
-
push({ kind: 'playlist', value: value, label: 'IPTV playlist · ' + shortLink(value), have: lists.indexOf(value) !== -1, note: '' });
|
|
668
|
+
push({ kind: 'playlist', value: value, label: U.t('IPTV playlist') + ' · ' + shortLink(value), have: lists.indexOf(value) !== -1, note: '' });
|
|
667
669
|
} else if (value.indexOf('://') !== -1 && normalizeManifestUrl(value)) {
|
|
668
670
|
var url = normalizeManifestUrl(value);
|
|
669
|
-
push({ kind: 'addon', value: url, label: 'Addon · ' + shortLink(url), have: mine.indexOf(url) !== -1, note: '' });
|
|
671
|
+
push({ kind: 'addon', value: url, label: U.t('Addon') + ' · ' + shortLink(url), have: mine.indexOf(url) !== -1, note: '' });
|
|
670
672
|
} else {
|
|
671
673
|
out.ignored++;
|
|
672
674
|
}
|
|
673
675
|
});
|
|
674
676
|
out.items.forEach(function (it) { // (a playlist's name, guide link, off: with it)
|
|
675
677
|
var d = it.kind === 'playlist' && details[it.value];
|
|
676
|
-
if (d) { it.info = d; if (typeof d.name === 'string' && d.name) { it.label = 'IPTV playlist · ' + d.name.slice(0, 60); } }
|
|
678
|
+
if (d) { it.info = d; if (typeof d.name === 'string' && d.name) { it.label = U.t('IPTV playlist') + ' · ' + d.name.slice(0, 60); } }
|
|
677
679
|
});
|
|
678
|
-
if (store.length) { push({ kind: 'settings', value: 'settings', entries: store, label: 'Your settings ('
|
|
680
|
+
if (store.length) { push({ kind: 'settings', value: 'settings', entries: store, label: U.tn(store.length, 'Your settings ({n} part)', 'Your settings ({n} parts)'), have: false, note: U.t('replaces yours') }); }
|
|
679
681
|
return out;
|
|
680
682
|
}
|
|
681
683
|
function playlistDetails(id, d) {
|
|
@@ -774,7 +776,8 @@ var Stremio = (function () {
|
|
|
774
776
|
|
|
775
777
|
// ---- Catalogs ----
|
|
776
778
|
// Returns list of {addon, type, id, name} across all addons.
|
|
777
|
-
var TYPE_LABELS = { movie: 'Movies', series: 'Series', tv: 'IPTV', radio: 'Radio', channel: 'Channels', people: 'People'
|
|
779
|
+
var TYPE_LABELS = { movie: U.t('Movies'), series: U.t('Series'), tv: 'IPTV', radio: U.t('Radio'), channel: U.t('Channels'), people: U.t('People'), sport: U.t('Sports'), sports: U.t('Sports'),
|
|
780
|
+
anime: U.t('Anime'), events: U.t('Events'), other: U.t('Other'), documentary: U.t('Documentary'), music: U.t('Music') };
|
|
778
781
|
function prettyType(t) {
|
|
779
782
|
if (TYPE_LABELS[t]) { return TYPE_LABELS[t]; }
|
|
780
783
|
return t ? (t.charAt(0).toUpperCase() + t.slice(1)) : '';
|
|
@@ -791,7 +794,7 @@ var Stremio = (function () {
|
|
|
791
794
|
// Include the type so per-type catalogs sharing a name (e.g. Cinemeta's
|
|
792
795
|
// "Popular" for both movie & series) don't look like duplicates.
|
|
793
796
|
cats.push({ addon: addon, type: c.type, id: c.id, def: c, label: label,
|
|
794
|
-
name: prettyType(c.type) + ' · ' + label + ' · ' + (addon.manifest.name || 'Addon') });
|
|
797
|
+
name: prettyType(c.type) + ' · ' + label + ' · ' + (addon.manifest.name || U.t('Addon')) });
|
|
795
798
|
});
|
|
796
799
|
});
|
|
797
800
|
return cats;
|
|
@@ -933,14 +936,14 @@ var Stremio = (function () {
|
|
|
933
936
|
// whether sources played before go first. Stored as { order: [keys], off: [keys], played }.
|
|
934
937
|
var RANKING_KEY = 'stremiok.ranking';
|
|
935
938
|
var RANK_CRITERIA = [
|
|
936
|
-
['res', 'Resolution (high to low)', '4K, 1440p, 1080p, 720p, SD, then unknown; at the top, the sources are grouped by resolution'],
|
|
937
|
-
['uncached', 'Not yet cached last', 'sources an addon marks as not cached on your debrid service yet (they can’t start right away)'],
|
|
938
|
-
['kind', 'Release type', 'remux > Blu-ray > web > unknown > TV rip, CAM rips far below'],
|
|
939
|
-
['hdr', 'HDR before SDR', 'HDR10 / HDR10+ / Dolby Vision first'],
|
|
940
|
-
['seeds', 'Seeders (high to low)', 'torrent sources with more people sharing them first, by the count they state (👤 123, or Seeders: 123); the others keep their order'],
|
|
941
|
-
['addon', 'Feed sources order', 'your order of the addons (at the bottom of this page)'],
|
|
942
|
-
['within', 'Each addon\'s own order', 'the order an addon lists its sources in (its first, then its second…); right after Feed sources order: each addon\'s list as it gives it'],
|
|
943
|
-
['cached', 'Cached before unknown', 'sources an addon marks as cached ahead of ones with no mark']
|
|
939
|
+
['res', U.t('Resolution (high to low)'), U.t('4K, 1440p, 1080p, 720p, SD, then unknown; at the top, the sources are grouped by resolution')],
|
|
940
|
+
['uncached', U.t('Not yet cached last'), U.t('sources an addon marks as not cached on your debrid service yet (they can’t start right away)')],
|
|
941
|
+
['kind', U.t('Release type'), U.t('remux > Blu-ray > web > unknown > TV rip, CAM rips far below')],
|
|
942
|
+
['hdr', U.t('HDR before SDR'), U.t('HDR10 / HDR10+ / Dolby Vision first')],
|
|
943
|
+
['seeds', U.t('Seeders (high to low)'), U.t('torrent sources with more people sharing them first, by the count they state (👤 123, or Seeders: 123); the others keep their order')],
|
|
944
|
+
['addon', U.t('Feed sources order'), U.t('your order of the addons (at the bottom of this page)')],
|
|
945
|
+
['within', U.t('Each addon\'s own order'), U.t('the order an addon lists its sources in (its first, then its second…); right after Feed sources order: each addon\'s list as it gives it')],
|
|
946
|
+
['cached', U.t('Cached before unknown'), U.t('sources an addon marks as cached ahead of ones with no mark')]
|
|
944
947
|
];
|
|
945
948
|
var RANK_OFF_DEFAULT = ['cached'];
|
|
946
949
|
var RANK_AFTER = { seeds: 'hdr' }; // (added in 2.2.1.13)
|
|
@@ -1026,23 +1029,23 @@ var Stremio = (function () {
|
|
|
1026
1029
|
function isErrorMeta(m) { return /^(aiostreamserror\.|aiom\.error\.)/.test('' + (m && m.id)); }
|
|
1027
1030
|
function getMeta(type, id, cancel) {
|
|
1028
1031
|
if (/^ytk:/.test(id) && typeof YouTube !== 'undefined') {
|
|
1029
|
-
return YouTube.meta(id).then(function (m) { if (!m) { throw new Error('Not found on YouTube'); } return m; });
|
|
1032
|
+
return YouTube.meta(id).then(function (m) { if (!m) { throw new Error(U.t('Not found on YouTube')); } return m; });
|
|
1030
1033
|
}
|
|
1031
1034
|
if (/^xv[ms]\./.test(id) && typeof XtVod !== 'undefined') {
|
|
1032
|
-
return XtVod.meta(type, id).then(function (m) { if (!m) { throw new Error('Not found on the Xtream server'); } return m; });
|
|
1035
|
+
return XtVod.meta(type, id).then(function (m) { if (!m) { throw new Error(U.t('Not found on the Xtream server')); } return m; });
|
|
1033
1036
|
}
|
|
1034
1037
|
if (/^sv[ms]\./.test(id) && typeof StVod !== 'undefined') {
|
|
1035
|
-
return StVod.meta(type, id).then(function (m) { if (!m) { throw new Error('Not found on the Stalker portal'); } return m; });
|
|
1038
|
+
return StVod.meta(type, id).then(function (m) { if (!m) { throw new Error(U.t('Not found on the Stalker portal')); } return m; });
|
|
1036
1039
|
}
|
|
1037
1040
|
if (/^jf[ms]\./.test(id) && typeof Jellyfin !== 'undefined') {
|
|
1038
|
-
return Jellyfin.meta(type, id).then(function (m) { if (!m) { throw new Error('Not found on the '
|
|
1041
|
+
return Jellyfin.meta(type, id).then(function (m) { if (!m) { throw new Error(U.t('Not found on the {server} server', { server: Jellyfin.nameOfId(id) })); } return m; });
|
|
1039
1042
|
}
|
|
1040
1043
|
if (/^px[ms]\./.test(id) && typeof Plex !== 'undefined') {
|
|
1041
|
-
return Plex.meta(type, id).then(function (m) { if (!m) { throw new Error('Not found on the Plex server'); } return m; });
|
|
1044
|
+
return Plex.meta(type, id).then(function (m) { if (!m) { throw new Error(U.t('Not found on the Plex server')); } return m; });
|
|
1042
1045
|
}
|
|
1043
1046
|
if (/^iptv:/.test(id)) {
|
|
1044
1047
|
return IPTV.meta(id).then(function (m) {
|
|
1045
|
-
if (!m) { throw new Error('IPTV channel not found'); }
|
|
1048
|
+
if (!m) { throw new Error(U.t('IPTV channel not found')); }
|
|
1046
1049
|
return m;
|
|
1047
1050
|
});
|
|
1048
1051
|
}
|
|
@@ -1058,10 +1061,10 @@ var Stremio = (function () {
|
|
|
1058
1061
|
providers = addons.filter(function (a) { return !a.__local && ownsId(a, 'meta', id); });
|
|
1059
1062
|
providers.forEach(function (a) { asType[a.url] = ownType(a, 'meta'); });
|
|
1060
1063
|
}
|
|
1061
|
-
if (!providers.length) { return Promise.reject(new Error('No meta addon for '
|
|
1064
|
+
if (!providers.length) { return Promise.reject(new Error(U.t('No meta addon for {type}', { type: type }))); }
|
|
1062
1065
|
var i = 0;
|
|
1063
1066
|
function tryNext() {
|
|
1064
|
-
if (i >= providers.length) { return Promise.reject(new Error('Meta not found')); }
|
|
1067
|
+
if (i >= providers.length) { return Promise.reject(new Error(U.t('Meta not found'))); }
|
|
1065
1068
|
var a = providers[i++];
|
|
1066
1069
|
var url = a.base + '/meta/' + encodeURIComponent(asType[a.url] || type) + '/' + encodeURIComponent(id) + '.json';
|
|
1067
1070
|
return U.getJSON(url, addonMs(12000), META_MAX, cancel).then(function (res) {
|
|
@@ -1158,18 +1161,18 @@ var Stremio = (function () {
|
|
|
1158
1161
|
var arr = U.listOf(a.__impl ? res.streams : fromAddon(a, res, 'sources').streams, MAX_STREAMS).map(youTubeSource).map(torrentSource), said = notes.length;
|
|
1159
1162
|
arr = arr.filter(function (s) { // (an addon's notices: what it removed and why, its errors; not sources)
|
|
1160
1163
|
if (!isNotice(s)) { return true; }
|
|
1161
|
-
notes.push({ addon: a.manifest.name || 'Addon', title: ('' + (s.name || '')).replace(/\s+/g, ' ').trim().slice(0, 120),
|
|
1164
|
+
notes.push({ addon: a.manifest.name || U.t('Addon'), title: ('' + (s.name || '')).replace(/\s+/g, ' ').trim().slice(0, 120),
|
|
1162
1165
|
text: ('' + (s.description || s.title || '')).split('\n').map(function (l) { return l.trim(); }).filter(Boolean).join(' · ').slice(0, 400) });
|
|
1163
1166
|
return false;
|
|
1164
1167
|
});
|
|
1165
1168
|
arr.forEach(function (s, n) {
|
|
1166
|
-
s._addon = a.manifest.name || 'Addon'; s._addonRank = i; s._addonPos = n;
|
|
1169
|
+
s._addon = a.manifest.name || U.t('Addon'); s._addonRank = i; s._addonPos = n;
|
|
1167
1170
|
// (a source that needs its own player settings: its User-Agent and Referer, as an IPTV channel's)
|
|
1168
1171
|
var ph = s.behaviorHints && s.behaviorHints.proxyHeaders, h = ph && ph.request ? U.sanitizeHeaders(ph.request) : null;
|
|
1169
1172
|
if (h) { s._headers = h; }
|
|
1170
1173
|
});
|
|
1171
1174
|
slots[i] = arr; okCount++;
|
|
1172
|
-
if (!arr.length && notes.length === said) { note(a, i, 'no sources for this'); } // (its notices say why, when it sent any)
|
|
1175
|
+
if (!arr.length && notes.length === said) { note(a, i, U.t('no sources for this')); } // (its notices say why, when it sent any)
|
|
1173
1176
|
}).then(function () { done(); }, function (err) {
|
|
1174
1177
|
// (no answer in time: what you played from it before, marked so — see keptSources)
|
|
1175
1178
|
if (isTimeout(err) && !slots[i].length) { slots[i] = keptSources(type, id, a, i); }
|
|
@@ -1180,7 +1183,7 @@ var Stremio = (function () {
|
|
|
1180
1183
|
}), 4);
|
|
1181
1184
|
}
|
|
1182
1185
|
// Why an addon gave nothing ("No sources found" shows it), in your addon order
|
|
1183
|
-
function note(a, i, why) { notes.push({ addon: a.manifest.name || 'Addon', title: why, text: '', rank: i }); }
|
|
1186
|
+
function note(a, i, why) { notes.push({ addon: a.manifest.name || U.t('Addon'), title: why, text: '', rank: i }); }
|
|
1184
1187
|
function done() {
|
|
1185
1188
|
e.pending--;
|
|
1186
1189
|
e.list = local.concat([].concat.apply([], slots));
|
|
@@ -1226,11 +1229,11 @@ var Stremio = (function () {
|
|
|
1226
1229
|
// "refused (HTTP 429 · rate_limited)", "didn't answer in time", "couldn't be reached"…
|
|
1227
1230
|
function whyNone(err) {
|
|
1228
1231
|
var m = String((err && err.message) || ''), h = /^HTTP (\d{3}) for \S+(?::\s+(.+))?$/.exec(m); // (its message after ": ", not the link's "://")
|
|
1229
|
-
if (h) { return 'refused (HTTP ' + h[1] + (h[2] ? ' · ' + h[2].replace(/https?:\/\/\S+/g, '…').slice(0, 80) : '')
|
|
1230
|
-
if (isTimeout(err)) { return 'didn’t answer in time'; }
|
|
1231
|
-
if (/^(No answer|Network error)/.test(m)) { return 'couldn’t be reached'; }
|
|
1232
|
-
if (/^Too large/.test(m)) { return 'sent too much ('
|
|
1233
|
-
return 'failed ('
|
|
1232
|
+
if (h) { return U.t('refused ({why})', { why: 'HTTP ' + h[1] + (h[2] ? ' · ' + h[2].replace(/https?:\/\/\S+/g, '…').slice(0, 80) : '') }); }
|
|
1233
|
+
if (isTimeout(err)) { return U.t('didn’t answer in time'); }
|
|
1234
|
+
if (/^(No answer|Network error)/.test(m)) { return U.t('couldn’t be reached'); }
|
|
1235
|
+
if (/^Too large/.test(m)) { return U.t('sent too much ({why})', { why: (/\(([^)]+)\)/.exec(m) || ['', U.t('too large')])[1] }); }
|
|
1236
|
+
return U.t('failed ({why})', { why: m.replace(/https?:\/\/\S+/g, '…').slice(0, 80) });
|
|
1234
1237
|
}
|
|
1235
1238
|
|
|
1236
1239
|
// The debrid service a source comes through, from its tag ("[TB⚡]", "[RD+]"): { tag, name } or null.
|
|
@@ -1289,7 +1292,7 @@ var Stremio = (function () {
|
|
|
1289
1292
|
U.store.set(KEPT_KEY, all);
|
|
1290
1293
|
}
|
|
1291
1294
|
function keptSources(type, id, addon, rank) {
|
|
1292
|
-
var name = (addon && addon.manifest && addon.manifest.name) || 'Addon', list = keptAll()[type + ':' + id];
|
|
1295
|
+
var name = (addon && addon.manifest && addon.manifest.name) || U.t('Addon'), list = keptAll()[type + ':' + id];
|
|
1293
1296
|
return (Array.isArray(list) ? list : []).filter(function (x) { return x && x.st && x.st._addon === name; }).map(function (x, n) {
|
|
1294
1297
|
var s = {};
|
|
1295
1298
|
Object.keys(x.st).forEach(function (k) { s[k] = x.st[k]; });
|
|
@@ -1350,7 +1353,7 @@ var Stremio = (function () {
|
|
|
1350
1353
|
var url = a.base + '/subtitles/' + encodeURIComponent(type) + '/' + encodeURIComponent(id) + (args.length ? '/' + args.join('&') : '') + '.json';
|
|
1351
1354
|
return U.getJSON(url, addonMs(15000)).then(function (res) { // (15 s: a subtitle addon may fetch them from elsewhere first)
|
|
1352
1355
|
var arr = U.listOf(fromAddon(a, res, 'subtitles').subtitles, MAX_SUBTITLES);
|
|
1353
|
-
arr.forEach(function (s) { s._addon = a.manifest.name || 'Addon'; });
|
|
1356
|
+
arr.forEach(function (s) { s._addon = a.manifest.name || U.t('Addon'); });
|
|
1354
1357
|
return arr;
|
|
1355
1358
|
});
|
|
1356
1359
|
};
|
|
@@ -1397,7 +1400,7 @@ var Stremio = (function () {
|
|
|
1397
1400
|
// Cached TMDB GET.
|
|
1398
1401
|
function tmdbGet(path, extra, cancel) {
|
|
1399
1402
|
var key = tmdbKey();
|
|
1400
|
-
if (!key) { return Promise.reject(new Error('no TMDB key')); }
|
|
1403
|
+
if (!key) { return Promise.reject(new Error(U.t('no TMDB key'))); }
|
|
1401
1404
|
return U.cachedJSON(_tmdbCache, 'https://api.themoviedb.org/3' + path + '?api_key=' + encodeURIComponent(key) + (extra || ''), 12000, cancel);
|
|
1402
1405
|
}
|
|
1403
1406
|
|
|
@@ -1477,12 +1480,12 @@ var Stremio = (function () {
|
|
|
1477
1480
|
out.push({ id: p.id, name: p.name || '', character: role || '', photo: photo !== undefined ? photo : tmdbImg(p.profile_path, 'w185') });
|
|
1478
1481
|
}
|
|
1479
1482
|
var crew = (ep && ep.crew) || [];
|
|
1480
|
-
crew.filter(function (c) { return c.job === 'Director'; }).forEach(function (c) { add(c, 'Director'); });
|
|
1483
|
+
crew.filter(function (c) { return c.job === 'Director'; }).forEach(function (c) { add(c, U.t('Director')); });
|
|
1481
1484
|
crew.filter(function (c) { return EP_CREW.test(c.job || ''); }).forEach(function (c) { add(c, c.job); });
|
|
1482
1485
|
((ep && ep.cast) || []).forEach(function (c) { add(c, c.character); });
|
|
1483
1486
|
((ep && ep.guest_stars) || []).forEach(function (c) { add(c, (c.character ? c.character + ' · ' : '') + 'guest'); });
|
|
1484
1487
|
if (out.length) {
|
|
1485
|
-
((sh && sh.cast) || []).forEach(function (c) { if (c.character === 'Creator') { add(c, 'Creator', c.photo); } });
|
|
1488
|
+
((sh && sh.cast) || []).forEach(function (c) { if (c.character === 'Creator') { add(c, U.t('Creator'), c.photo); } });
|
|
1486
1489
|
return out;
|
|
1487
1490
|
}
|
|
1488
1491
|
return (sh && sh.cast) || []; // (nothing for the episode: the show's)
|
|
@@ -1495,7 +1498,7 @@ var Stremio = (function () {
|
|
|
1495
1498
|
// official ones first, a trailer before a teaser; never a clip (a scene from the episode),
|
|
1496
1499
|
// bloopers or behind the scenes. imdbId: the show's (tt…).
|
|
1497
1500
|
// -> { ytId, season: true when it's the season's } or null (none, no TMDB key, no answer).
|
|
1498
|
-
var TRAILER_TYPES = ['Trailer', 'Teaser'];
|
|
1501
|
+
var TRAILER_TYPES = ['Trailer', 'Teaser']; // (TMDB's video types: not words shown)
|
|
1499
1502
|
function bestTrailer(r) {
|
|
1500
1503
|
var vids = U.listOf(r && r.results, 100, function (v) {
|
|
1501
1504
|
return v.site === 'YouTube' && typeof v.key === 'string' && /^[A-Za-z0-9_-]{11}$/.test(v.key) && TRAILER_TYPES.indexOf(v.type) !== -1;
|
|
@@ -1536,7 +1539,7 @@ var Stremio = (function () {
|
|
|
1536
1539
|
var here = r && r.results && r.results[watchRegion()];
|
|
1537
1540
|
if (!here) { return []; }
|
|
1538
1541
|
var out = [], seen = {};
|
|
1539
|
-
[['flatrate', 'Subscription'], ['free', 'Free'], ['ads', 'Free with ads']].forEach(function (k) {
|
|
1542
|
+
[['flatrate', U.t('Subscription')], ['free', U.t('Free')], ['ads', U.t('Free with ads')]].forEach(function (k) {
|
|
1540
1543
|
U.listOf(here[k[0]], 30).forEach(function (p) {
|
|
1541
1544
|
if (!p || !p.provider_name || seen[p.provider_name]) { return; }
|
|
1542
1545
|
seen[p.provider_name] = true;
|
|
@@ -1571,7 +1574,7 @@ var Stremio = (function () {
|
|
|
1571
1574
|
});
|
|
1572
1575
|
var bits = [];
|
|
1573
1576
|
if (p.known_for_department) { bits.push(p.known_for_department); }
|
|
1574
|
-
if (p.birthday) { bits.push('Born '
|
|
1577
|
+
if (p.birthday) { bits.push(U.t('Born {years}', { years: p.birthday.slice(0, 4) + (p.deathday ? ' – ' + p.deathday.slice(0, 4) : '') })); }
|
|
1575
1578
|
if (p.place_of_birth) { bits.push(p.place_of_birth); }
|
|
1576
1579
|
return { name: p.name || '', photo: tmdbImg(p.profile_path, 'w342'), bio: p.biography || '', meta: bits.join(' · '),
|
|
1577
1580
|
movies: credits.filter(function (c) { return c.kind === 'movie'; }).sort(byVotes).slice(0, PERSON_MAX),
|
|
@@ -1603,10 +1606,10 @@ var Stremio = (function () {
|
|
|
1603
1606
|
// ---- Browse (Discover, with a TMDB key): Trending, Popular, and each streaming service in
|
|
1604
1607
|
// your country, TMDB's, with its genres. ----
|
|
1605
1608
|
var TMDB_GENRES = {
|
|
1606
|
-
movie: [['Action', 28], ['Adventure', 12], ['Animation', 16], ['Comedy', 35], ['Crime', 80], ['Documentary', 99], ['Drama', 18], ['Family', 10751],
|
|
1607
|
-
['Fantasy', 14], ['History', 36], ['Horror', 27], ['Music', 10402], ['Mystery', 9648], ['Romance', 10749], ['Science Fiction', 878], ['Thriller', 53], ['War', 10752], ['Western', 37]],
|
|
1608
|
-
tv: [['Action & Adventure', 10759], ['Animation', 16], ['Comedy', 35], ['Crime', 80], ['Documentary', 99], ['Drama', 18], ['Family', 10751], ['Kids', 10762],
|
|
1609
|
-
['Mystery', 9648], ['Reality', 10764], ['Sci-Fi & Fantasy', 10765], ['Soap', 10766], ['Talk', 10767], ['War & Politics', 10768], ['Western', 37]]
|
|
1609
|
+
movie: [[U.t('Action'), 28], [U.t('Adventure'), 12], [U.t('Animation'), 16], [U.t('Comedy'), 35], [U.t('Crime'), 80], [U.t('Documentary'), 99], [U.t('Drama'), 18], [U.t('Family'), 10751],
|
|
1610
|
+
[U.t('Fantasy'), 14], [U.t('History'), 36], [U.t('Horror'), 27], [U.t('Music'), 10402], [U.t('Mystery'), 9648], [U.t('Romance'), 10749], [U.t('Science Fiction'), 878], [U.t('Thriller'), 53], [U.t('War'), 10752], [U.t('Western'), 37]],
|
|
1611
|
+
tv: [[U.t('Action & Adventure'), 10759], [U.t('Animation'), 16], [U.t('Comedy'), 35], [U.t('Crime'), 80], [U.t('Documentary'), 99], [U.t('Drama'), 18], [U.t('Family'), 10751], [U.t('Kids'), 10762],
|
|
1612
|
+
[U.t('Mystery'), 9648], [U.t('Reality'), 10764], [U.t('Sci-Fi & Fantasy'), 10765], [U.t('Soap'), 10766], [U.t('Talk'), 10767], [U.t('War & Politics'), 10768], [U.t('Western'), 37]]
|
|
1610
1613
|
};
|
|
1611
1614
|
function tmdbGenres(kind) { return (TMDB_GENRES[kind] || []).map(function (g) { return g[0]; }); }
|
|
1612
1615
|
// The streaming services in your country (the biggest first, PROVIDERS_MAX), kept a week:
|
|
@@ -1728,7 +1731,7 @@ var Stremio = (function () {
|
|
|
1728
1731
|
|
|
1729
1732
|
// ---- MDBList ratings (Settings > Integrations > MDBList) ----
|
|
1730
1733
|
// -> [{ key, label, text }] in a fixed order, only the ones the title has.
|
|
1731
|
-
var MDB_SOURCES = [['imdb', 'IMDb'], ['tomatoes', 'Rotten Tomatoes'], ['popcorn', 'Audience'],
|
|
1734
|
+
var MDB_SOURCES = [['imdb', 'IMDb'], ['tomatoes', 'Rotten Tomatoes'], ['popcorn', U.t('Audience')],
|
|
1732
1735
|
['metacritic', 'Metacritic'], ['letterboxd', 'Letterboxd'], ['tmdb', 'TMDB']];
|
|
1733
1736
|
function mdblistRatings(type, imdbId, cancel) {
|
|
1734
1737
|
var key = getIntegrations().mdblist;
|
|
@@ -2033,13 +2036,13 @@ var Stremio = (function () {
|
|
|
2033
2036
|
if (c.addon && c.addon.__local) {
|
|
2034
2037
|
if (!local[c.type]) {
|
|
2035
2038
|
local[c.type] = { key: 'iptv-search|' + c.type, cats: [], title: prettyType(c.type),
|
|
2036
|
-
name: prettyType(c.type) + ' · every group · your playlists', pages: false };
|
|
2039
|
+
name: prettyType(c.type) + ' · ' + U.t('every group · your playlists'), pages: false };
|
|
2037
2040
|
out.push(local[c.type]);
|
|
2038
2041
|
}
|
|
2039
2042
|
local[c.type].cats.push(c);
|
|
2040
2043
|
return;
|
|
2041
2044
|
}
|
|
2042
|
-
var def = c.def || {}, label = def.name || c.id, addonName = (c.addon.manifest && c.addon.manifest.name) || 'Addon';
|
|
2045
|
+
var def = c.def || {}, label = def.name || c.id, addonName = (c.addon.manifest && c.addon.manifest.name) || U.t('Addon');
|
|
2043
2046
|
var title = prettyType(c.type) + ' · ' + (/^search$/i.test(('' + label).trim()) ? '' : label + ' · ') + addonName;
|
|
2044
2047
|
out.push({ key: catalogKey(c), cats: [c], title: title, name: title.replace(/ · /g, ' · '),
|
|
2045
2048
|
pages: (def.extra || []).some(function (e) { return e && e.name === 'skip'; }) || (def.extraSupported || []).indexOf('skip') !== -1 });
|
|
@@ -2095,16 +2098,16 @@ var Stremio = (function () {
|
|
|
2095
2098
|
// Does it answer? { ok, text } — Stremio's /settings (its version in it), TorrServer's /echo.
|
|
2096
2099
|
function testServer() {
|
|
2097
2100
|
var sv = server();
|
|
2098
|
-
if (!sv.kind || !sv.url) { return Promise.resolve({ ok: false, text: 'No server set' }); }
|
|
2101
|
+
if (!sv.kind || !sv.url) { return Promise.resolve({ ok: false, text: U.t('No server set') }); }
|
|
2099
2102
|
var p = sv.kind === 'stremio'
|
|
2100
2103
|
? U.getJSON(sv.url + '/settings', 8000).then(function (r) {
|
|
2101
|
-
if (!r || typeof r !== 'object') { throw new Error('Not a Stremio streaming server'); }
|
|
2104
|
+
if (!r || typeof r !== 'object') { throw new Error(U.t('Not a Stremio streaming server')); }
|
|
2102
2105
|
var v = r.values && r.values.serverVersion;
|
|
2103
|
-
return 'Stremio server answers
|
|
2106
|
+
return v ? U.t('Stremio server answers ({v})', { v: ('' + v).slice(0, 20) }) : U.t('Stremio server answers');
|
|
2104
2107
|
})
|
|
2105
|
-
: U.getText(sv.url + '/echo', 8000).then(function (t) { return 'TorrServer answers ('
|
|
2108
|
+
: U.getText(sv.url + '/echo', 8000).then(function (t) { return U.t('TorrServer answers ({v})', { v: ('' + t).trim().slice(0, 30) }); });
|
|
2106
2109
|
return p.then(function (text) { return { ok: true, text: text }; },
|
|
2107
|
-
function (e) { return { ok: false, text: 'The server didn’t answer: '
|
|
2110
|
+
function (e) { return { ok: false, text: U.t('The server didn’t answer: {why}', { why: U.problem(e) }) }; });
|
|
2108
2111
|
}
|
|
2109
2112
|
// Made again each time it's asked (a page kept from before, just before playing): from the
|
|
2110
2113
|
// server set now, or no link when there's none.
|
|
@@ -2168,13 +2171,13 @@ var Stremio = (function () {
|
|
|
2168
2171
|
}
|
|
2169
2172
|
|
|
2170
2173
|
function streamLabel(stream) {
|
|
2171
|
-
var t = stream.title || stream.name || stream.description || 'Stream';
|
|
2174
|
+
var t = stream.title || stream.name || stream.description || U.t('Stream');
|
|
2172
2175
|
return ('' + t).replace(/\n/g, ' ');
|
|
2173
2176
|
}
|
|
2174
2177
|
|
|
2175
2178
|
// Short first-line label (quality / addon tag), e.g. "MediaFusion 2160p".
|
|
2176
2179
|
function streamName(stream) {
|
|
2177
|
-
var t = stream.name || stream.title || stream.description || 'Source';
|
|
2180
|
+
var t = stream.name || stream.title || stream.description || U.t('Source');
|
|
2178
2181
|
return U.drawable(('' + t).split('\n')[0]).trim(); // (without characters the TV can't draw)
|
|
2179
2182
|
}
|
|
2180
2183
|
|
|
@@ -2273,15 +2276,15 @@ var Stremio = (function () {
|
|
|
2273
2276
|
// different files, at least once as the only suspect. You can set any either way.
|
|
2274
2277
|
var FORMATS_KEY = 'stremiok.formats';
|
|
2275
2278
|
var FORMAT_LABELS = {
|
|
2276
|
-
'v:h264': ['Video', 'H.264 (AVC)'], 'v:hevc': ['Video', 'HEVC (H.265)'], 'v:av1': ['Video', 'AV1'], 'v:10bit': ['Video', '10-bit color'],
|
|
2277
|
-
'h:hdr': ['HDR', 'HDR10 / HLG'], 'h:hdr10p': ['HDR', 'HDR10+'], 'h:dv': ['HDR', 'Dolby Vision (with HDR fallback)'], 'h:dv-only': ['HDR', 'Dolby Vision only'],
|
|
2279
|
+
'v:h264': ['Video', 'H.264 (AVC)'], 'v:hevc': ['Video', 'HEVC (H.265)'], 'v:av1': ['Video', 'AV1'], 'v:10bit': ['Video', U.t('10-bit color')],
|
|
2280
|
+
'h:hdr': ['HDR', 'HDR10 / HLG'], 'h:hdr10p': ['HDR', 'HDR10+'], 'h:dv': ['HDR', U.t('Dolby Vision (with HDR fallback)')], 'h:dv-only': ['HDR', U.t('Dolby Vision only')],
|
|
2278
2281
|
'a:atmos': ['Audio', 'Dolby Atmos'], 'a:truehd': ['Audio', 'Dolby TrueHD'], 'a:dtshd': ['Audio', 'DTS-HD / DTS:X'], 'a:dts': ['Audio', 'DTS'],
|
|
2279
2282
|
'a:eac3': ['Audio', 'Dolby Digital Plus (EAC3)'], 'a:ac3': ['Audio', 'Dolby Digital (AC3)'], 'a:aac': ['Audio', 'AAC'], 'a:opus': ['Audio', 'Opus'], 'a:flac': ['Audio', 'FLAC'],
|
|
2280
|
-
'c:mkv': ['File', 'MKV'], 'c:mp4': ['File', 'MP4'], 'c:avi': ['File', 'AVI'], 'c:webm': ['File', 'WebM'], 'c:ts': ['File', 'MPEG-TS'], 'c:hls': ['File', 'HLS stream']
|
|
2283
|
+
'c:mkv': ['File', 'MKV'], 'c:mp4': ['File', 'MP4'], 'c:avi': ['File', 'AVI'], 'c:webm': ['File', 'WebM'], 'c:ts': ['File', 'MPEG-TS'], 'c:hls': ['File', U.t('HLS stream')]
|
|
2281
2284
|
};
|
|
2282
|
-
var PROFILE_RES = { 2160: '4K', 1440: '1440p', 1080: '1080p', 720: '720p', 480: 'SD', 0: 'Unknown resolution' };
|
|
2283
|
-
var PROFILE_CODEC = { h264: 'H.264', hevc: 'HEVC', av1: 'AV1', '?': 'unknown codec' };
|
|
2284
|
-
var PROFILE_HDR = { hdr: 'HDR10', hdr10p: 'HDR10+', dv: 'Dolby Vision + HDR', 'dv-only': 'Dolby Vision only', sdr: 'SDR' };
|
|
2285
|
+
var PROFILE_RES = { 2160: '4K', 1440: '1440p', 1080: '1080p', 720: '720p', 480: 'SD', 0: U.t('Unknown resolution') };
|
|
2286
|
+
var PROFILE_CODEC = { h264: 'H.264', hevc: 'HEVC', av1: 'AV1', '?': U.t('unknown codec') };
|
|
2287
|
+
var PROFILE_HDR = { hdr: 'HDR10', hdr10p: 'HDR10+', dv: 'Dolby Vision + HDR', 'dv-only': U.t('Dolby Vision only'), sdr: 'SDR' };
|
|
2285
2288
|
// "p:<res>|<codec>|<bits>|<hdr>", or null when neither resolution nor codec is known.
|
|
2286
2289
|
// HDR is 10-bit even when the name doesn't say so.
|
|
2287
2290
|
function profileKey(info) {
|
|
@@ -2314,7 +2317,7 @@ var Stremio = (function () {
|
|
|
2314
2317
|
if (heard && aud.indexOf(heard) === -1) { aud = aud.filter(function (x) { return x === 'atmos'; }).concat([heard]); }
|
|
2315
2318
|
aud.slice(0, 2).forEach(function (x) { out.push(SHORT_AUDIO[x] || x); });
|
|
2316
2319
|
var ch = +actual.channels || 0;
|
|
2317
|
-
if (ch) { out.push(ch === 6 ? '5.1' : ch === 8 ? '7.1' : ch === 2 ? 'Stereo' : ch === 1 ? 'Mono' : ch + 'ch'); }
|
|
2320
|
+
if (ch) { out.push(ch === 6 ? '5.1' : ch === 8 ? '7.1' : ch === 2 ? U.t('Stereo') : ch === 1 ? U.t('Mono') : ch + 'ch'); }
|
|
2318
2321
|
if (info.container && info.container !== 'hls') { out.push(info.container.toUpperCase()); }
|
|
2319
2322
|
return out.join(' · ');
|
|
2320
2323
|
}
|
|
@@ -2369,7 +2372,7 @@ var Stremio = (function () {
|
|
|
2369
2372
|
// Allowed resolutions: yours to set (all allowed to begin with). A source at one that
|
|
2370
2373
|
// isn't goes with the "Not working" ones: bottom of the list, never Play best / Next.
|
|
2371
2374
|
var RES_KEY = 'stremiok.resblock';
|
|
2372
|
-
var RES_CHOICES = [[2160, '4K'], [1440, '1440p'], [1080, '1080p'], [720, '720p'], [480, 'SD'], [0, 'Unknown']];
|
|
2375
|
+
var RES_CHOICES = [[2160, '4K'], [1440, '1440p'], [1080, '1080p'], [720, '720p'], [480, 'SD'], [0, U.t('Unknown')]];
|
|
2373
2376
|
function resBucket(res) { return res >= 2160 ? 2160 : res >= 1440 ? 1440 : res >= 1080 ? 1080 : res >= 720 ? 720 : res > 0 ? 480 : 0; }
|
|
2374
2377
|
function resList() {
|
|
2375
2378
|
var off = U.store.get(RES_KEY, {}) || {};
|
|
@@ -2406,7 +2409,7 @@ var Stremio = (function () {
|
|
|
2406
2409
|
addonUrlProblem: function (v) { return U.urlProblem(v); },
|
|
2407
2410
|
getAddonUrls: getAddonUrls, manifestProblem: function (url) { return _manifestProblem[url] || ''; }, manifestDetail: function (url) { return _manifestDetail[url] || ''; }, addAddon: addAddon, removeAddon: removeAddon, moveAddon: moveAddon, streamNotes: streamNotes, keepSource: keepSource, forgetSource: forgetSource, sourceId: sourceId, hasStreamAddons: hasStreamAddons, thirdPartyNote: thirdPartyNote, refreshAddons: refreshAddons, refreshAddon: refreshAddon,
|
|
2408
2411
|
getIntegrations: getIntegrations, setIntegration: setIntegration, getPrefs: getPrefs, setPref: setPref, addonLogo: addonLogo,
|
|
2409
|
-
getIntroSegments: getIntroSegments,
|
|
2412
|
+
getIntroSegments: getIntroSegments, tmdbFind: tmdbFind,
|
|
2410
2413
|
tmdbValidate: tmdbValidate, mdblistValidate: mdblistValidate, omdbValidate: omdbValidate,
|
|
2411
2414
|
tmdbFindTvId: tmdbFindTvId, tmdbSeasonEpisodes: tmdbSeasonEpisodes, tmdbImg: tmdbImg,
|
|
2412
2415
|
tmdbTitleExtras: tmdbTitleExtras, tmdbExtrasById: tmdbExtrasById, tmdbEpisodeCast: tmdbEpisodeCast, tmdbEpisodeTrailer: tmdbEpisodeTrailer, setHideWords: setHideWords, hideWordHit: hideWordHit, normalizeAddonUrl: normalizeManifestUrl, debridOf: debridOf, addonOrigin: addonOrigin, setAddonOrigin: setAddonOrigin, parseSetupList: parseSetupList, applySetupEntries: applySetupEntries, exportGroups: exportGroups, exportSetup: exportSetup, sizeLimitHit: sizeLimitHit, setSizeLimit: setSizeLimit, gbText: gbText, runtimeMinutes: runtimeMinutes, tmdbPeople: tmdbPeople, tmdbPerson: tmdbPerson, tmdbBrowse: tmdbBrowse, tmdbTitleTrailers: tmdbTitleTrailers, tmdbProviders: tmdbProviders, tmdbProvidersKept: tmdbProvidersKept, tmdbGenres: tmdbGenres, tmdbWhereToWatch: tmdbWhereToWatch, watchRegion: watchRegion, autoWatchRegion: autoWatchRegion, tmdbImdbId: tmdbImdbId, findFilm: findFilm, hasTmdb: function () { return !!tmdbKey(); },
|
|
@@ -2418,7 +2421,7 @@ var Stremio = (function () {
|
|
|
2418
2421
|
getMeta: getMeta, getStreams: getStreams, prefetchStreams: prefetchStreams, dedupeStreams: dedupeStreams,
|
|
2419
2422
|
getSubtitles: getSubtitles,
|
|
2420
2423
|
getSearchCatalogs: getSearchCatalogs, findTitles: findTitles,
|
|
2421
|
-
addonsChanged: function () { _loaded = null; }, // (StremioK's own YouTube catalogs changed)
|
|
2424
|
+
addonsChanged: function () { _loaded = null; }, sourcesChanged: sourcesChanged, // (StremioK's own YouTube catalogs changed)
|
|
2422
2425
|
setAllowLocal: function (on) { setPref('allowLocal', !!on); var kept = _loaded; configChanged(); _loaded = kept; },
|
|
2423
2426
|
getRanking: getRanking, moveRanking: moveRanking, toggleRanking: toggleRanking,
|
|
2424
2427
|
setPlayedFirst: setPlayedFirst, resetRanking: resetRanking,
|
package/js/stvod.js
CHANGED
|
@@ -34,7 +34,7 @@ var StVod = (function () {
|
|
|
34
34
|
function setKeepMinutes(m) { U.store.set(KEEP_KEY, KEEPS.indexOf(+m) !== -1 ? +m : 10); }
|
|
35
35
|
// The service's answer ({ why }: an error).
|
|
36
36
|
function ask(acc, more) {
|
|
37
|
-
if (typeof YTPlay === 'undefined' || !YTPlay.stalkerVod) { return Promise.reject(new Error('Stalker portals are read by StremioK’s service (not in a desktop browser)')); }
|
|
37
|
+
if (typeof YTPlay === 'undefined' || !YTPlay.stalkerVod) { return Promise.reject(new Error(U.t('Stalker portals are read by StremioK’s service (not in a desktop browser)'))); }
|
|
38
38
|
return YTPlay.stalkerVod(acc.url, acc.mac, more + '&keep=' + keepMinutes()).then(function (r) {
|
|
39
39
|
if (!r || r.why) { throw new Error((r && r.why) || 'no answer'); }
|
|
40
40
|
return r;
|
|
@@ -205,7 +205,7 @@ var StVod = (function () {
|
|
|
205
205
|
if (list(it.cast).length) { m.cast = list(it.cast); }
|
|
206
206
|
if (list(it.director).length) { m.director = list(it.director); }
|
|
207
207
|
if (it.rating > 0) { m.imdbRating = (+it.rating).toFixed(1); }
|
|
208
|
-
if (it.mins > 0) { m.runtime =
|
|
208
|
+
if (it.mins > 0) { m.runtime = U.t('{n} min', { n: it.mins }); }
|
|
209
209
|
if (it.year) { m.releaseInfo = '' + it.year; m.year = '' + it.year; }
|
|
210
210
|
return m;
|
|
211
211
|
}
|
|
@@ -221,10 +221,10 @@ var StVod = (function () {
|
|
|
221
221
|
return seasons(x.acc, x).then(function (l) {
|
|
222
222
|
if (!it && !l.length) { return null; }
|
|
223
223
|
if (it) { remember(x.base, it); }
|
|
224
|
-
var m = details({ id: x.base, type: 'series', name: it ? it.name : 'Series', _from: x.acc.label }, it || {});
|
|
224
|
+
var m = details({ id: x.base, type: 'series', name: it ? it.name : U.t('Series'), _from: x.acc.label }, it || {});
|
|
225
225
|
m.videos = [];
|
|
226
226
|
l.forEach(function (se) {
|
|
227
|
-
(se.eps || []).forEach(function (ep) { m.videos.push({ id: x.base + ':' + se.season + ':' + ep.n, season: se.season, episode: ep.n, title: ep.name || 'Episode '
|
|
227
|
+
(se.eps || []).forEach(function (ep) { m.videos.push({ id: x.base + ':' + se.season + ':' + ep.n, season: se.season, episode: ep.n, title: ep.name || U.t('Episode {n}', { n: ep.n }) }); });
|
|
228
228
|
});
|
|
229
229
|
return m;
|
|
230
230
|
});
|