stremiok 2.3.5 → 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 +10 -0
- package/README.md +13 -13
- package/config.xml +1 -1
- package/index.html +43 -42
- package/js/lang/ar.js +33 -2
- package/js/lang/de.js +41 -10
- package/js/lang/es.js +31 -0
- package/js/lang/fi.js +37 -6
- package/js/lang/fr.js +41 -10
- package/js/lang/he.js +33 -2
- package/js/lang/hi.js +33 -2
- package/js/lang/it.js +33 -2
- package/js/lang/ja.js +33 -2
- package/js/lang/ko.js +31 -0
- package/js/lang/pl.js +57 -26
- package/js/lang/pt-BR.js +31 -0
- package/js/lang/ru.js +33 -2
- package/js/lang/tr.js +33 -2
- package/js/lang/zh-CN.js +35 -4
- package/js/player-core.js +31 -1
- package/js/plugins.js +270 -0
- package/js/stremio.js +3 -2
- package/js/util.js +10 -1
- 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-detail.js +8 -4
- package/js/view-settings.js +85 -1
- package/js/ytplay.js +28 -3
- package/package.json +1 -1
- package/service/index.js +227 -13
- package/tizenbrew.html +1 -1
package/js/lang/zh-CN.js
CHANGED
|
@@ -40,6 +40,7 @@ I18N.add("zh-CN", {
|
|
|
40
40
|
"+ Add a Jellyfin or Emby server": "+ 添加 Jellyfin 或 Emby 服务器",
|
|
41
41
|
"+ Add a Plex server": "+ 添加 Plex 服务器",
|
|
42
42
|
"+ Add a network folder": "+ 添加网络文件夹",
|
|
43
|
+
"+ Add a repository": "+ 添加仓库",
|
|
43
44
|
"00:1A:79:00:00:00": "00:1A:79:00:00:00",
|
|
44
45
|
"1 minute": "1 分钟",
|
|
45
46
|
"10-bit color": "10 位色彩",
|
|
@@ -66,6 +67,7 @@ I18N.add("zh-CN", {
|
|
|
66
67
|
"A source with one of them in its name, description or file name (a whole word: “CAM” isn’t in “CAMERA”) goes to the bottom, for every title · OK to change": "名称、描述或文件名中含有其中任一词(需为完整单词:“CAMERA”不算含有“CAM”)的片源,在所有影片中都排到最后 · 按 OK 更改",
|
|
67
68
|
"A still from the video in place of a clickbait thumbnail, where viewers chose one": "用视频中的画面替换标题党缩略图(仅限观众选过画面的视频)",
|
|
68
69
|
"A video’s direct link (an MKV or MP4 file, an HLS .m3u8) or a YouTube video’s page. It plays as it is, and nothing about it is recorded.": "视频直链(MKV 或 MP4 文件、HLS .m3u8)或 YouTube 视频页面。将按原样播放,不会留下任何记录。",
|
|
70
|
+
"A web address, like https://example.com/plugins/manifest.json": "网址,例如 https://example.com/plugins/manifest.json",
|
|
69
71
|
"AI-dubbed by YouTube": "YouTube AI 配音",
|
|
70
72
|
"AIOManager forgotten": "已移除 AIOManager",
|
|
71
73
|
"AIOManager refused the API key: enter it again": "AIOManager 拒绝了 API 密钥:请重新输入",
|
|
@@ -93,6 +95,8 @@ I18N.add("zh-CN", {
|
|
|
93
95
|
"Added to favorites: ★ Favorites, first on the IPTV tab": "已收藏:★ 收藏位于 IPTV 标签页的最前面",
|
|
94
96
|
"Added to your Stremio Library": "已添加到你的 Stremio 片库",
|
|
95
97
|
"Added “{name}” to your YouTube catalogs": "已将“{name}”添加到你的 YouTube 目录",
|
|
98
|
+
"Added “{name}”: {n} plugin (off until you turn it on)": "已添加“{name}”:{n} 个插件(开启前保持关闭)",
|
|
99
|
+
"Added “{name}”: {n} plugins (off until you turn them on)": "已添加“{name}”:{n} 个插件(开启前保持关闭)",
|
|
96
100
|
"Added, not started yet": "已添加,尚未开始",
|
|
97
101
|
"Added: OK on it to rename it or change what it lists": "已添加:在其上按 OK 可重命名或更改其列出的内容",
|
|
98
102
|
"Adding this channel’s captions…": "正在添加此频道的字幕…",
|
|
@@ -297,6 +301,7 @@ I18N.add("zh-CN", {
|
|
|
297
301
|
"Couldn't load {name}": "无法加载 {name}",
|
|
298
302
|
"Couldn't open {name}: {why}": "无法打开 {name}:{why}",
|
|
299
303
|
"Couldn't reach TMDB.": "无法连接 TMDB。",
|
|
304
|
+
"Couldn’t add it: {why}": "无法添加:{why}",
|
|
300
305
|
"Couldn’t change it (Diagnostics › Logs says why)": "无法更改(原因见 诊断 › 日志)",
|
|
301
306
|
"Couldn’t check": "无法检查",
|
|
302
307
|
"Couldn’t get a code from Plex ({why}).": "无法从 Plex 获取代码({why})。",
|
|
@@ -314,6 +319,7 @@ I18N.add("zh-CN", {
|
|
|
314
319
|
"Couldn’t read your AIOManager addons ({why})": "无法读取你的 AIOManager 插件({why})",
|
|
315
320
|
"Couldn’t reconnect": "无法重新连接",
|
|
316
321
|
"Couldn’t refresh it (showing the saved copy):": "无法刷新(显示已保存的副本):",
|
|
322
|
+
"Couldn’t refresh it: {why}": "无法刷新:{why}",
|
|
317
323
|
"Couldn’t sign in ({why}).": "无法登录({why})。",
|
|
318
324
|
"Couldn’t start Quick Connect ({why}).": "无法启动快速连接({why})。",
|
|
319
325
|
"Couldn’t start the download: {why}": "无法开始下载:{why}",
|
|
@@ -407,6 +413,7 @@ I18N.add("zh-CN", {
|
|
|
407
413
|
"Exclusive access": "独占访问",
|
|
408
414
|
"Exit": "退出",
|
|
409
415
|
"Exit StremioK?": "退出 StremioK?",
|
|
416
|
+
"Experimental on this TV: plugins haven’t been tried on its generation yet, and run slower here (one at a time).": "此电视上为实验性功能:插件尚未在这一代电视上测试过,且在此运行较慢(逐个运行)。",
|
|
410
417
|
"Export configuration": "导出配置",
|
|
411
418
|
"Export {n}": "导出 {n} 项",
|
|
412
419
|
"Extra Large": "特大",
|
|
@@ -446,7 +453,7 @@ I18N.add("zh-CN", {
|
|
|
446
453
|
"Format: {format}": "格式:{format}",
|
|
447
454
|
"Formats": "格式",
|
|
448
455
|
"Formats that keep failing to start are marked Not working · OK to turn off": "反复无法开始播放的格式会被标记为不可用 · 按 OK 关闭",
|
|
449
|
-
"Forward 10′": "前进 10
|
|
456
|
+
"Forward 10′": "前进 10′",
|
|
450
457
|
"Forward 5′": "前进 5′",
|
|
451
458
|
"France": "法国",
|
|
452
459
|
"Free": "免费",
|
|
@@ -511,7 +518,7 @@ I18N.add("zh-CN", {
|
|
|
511
518
|
"Home › Local shows your drive. Videos are matched to titles by their names, and a matched one plays as that title. Index a drive to have its videos and subtitle files offered on their title pages.": "首页 › 本地 会显示你的驱动器。视频会根据名称匹配到影片,匹配后将作为该影片播放。为驱动器建立索引后,其中的视频和字幕文件将显示在对应影片页面上。",
|
|
512
519
|
"Home’s saved rows": "首页已保存的行",
|
|
513
520
|
"Home’s saved rows, IPTV playlist copies, saved TV guides and Xtream lists, the USB index: made again when needed (playlists, guides and lists download again)": "首页已保存的行、IPTV 播放列表副本、已保存的节目单和 Xtream 列表、USB 索引:需要时会重新生成(播放列表、节目单和列表会重新下载)",
|
|
514
|
-
"Hong Kong": "
|
|
521
|
+
"Hong Kong": "中国香港",
|
|
515
522
|
"Horror": "恐怖",
|
|
516
523
|
"How far ◀ ▶ jump; a bigger buffer for slow connections; reconnecting live channels": "◀ ▶ 的跳转幅度;为慢速网络加大缓冲;直播频道重新连接",
|
|
517
524
|
"How sources are ordered (played before, resolution, release type…), and your addons: their order, on or off": "片源的排序方式(播放过的、分辨率、发行类型…),以及你的插件:顺序、开启或关闭",
|
|
@@ -582,10 +589,12 @@ I18N.add("zh-CN", {
|
|
|
582
589
|
"Its TV guide didn’t come: asked again shortly": "未收到其节目单:稍后将再次请求",
|
|
583
590
|
"Its WebDAV address, like http://192.168.0.50:8080/media (https:// too). RETURN cancels.": "其 WebDAV 地址,例如 http://192.168.0.50:8080/media(也支持 https://)。按 RETURN 取消。",
|
|
584
591
|
"Its WebDAV address, then the user name and password it asks for, if any": "其 WebDAV 地址,然后是所需的用户名和密码(如有)",
|
|
592
|
+
"Its address (a manifest.json): its plugins are listed, each off until you turn it on": "其地址(manifest.json):会列出其中的插件,每个在你开启前保持关闭",
|
|
585
593
|
"Its address and MAC address: its channels added": "其地址和 MAC 地址:将添加其频道",
|
|
586
594
|
"Its address on your network, like http://192.168.0.50:8096. RETURN cancels.": "其在你网络中的地址,例如 http://192.168.0.50:8096。按 RETURN 取消。",
|
|
587
595
|
"Its address on your network, like {example}. RETURN cancels.": "其在你网络中的地址,例如 {example}。按 RETURN 取消。",
|
|
588
596
|
"Its address on your network, then a user name and password, or Jellyfin’s Quick Connect": "其在你网络中的地址,然后是用户名和密码,或 Jellyfin 的快速连接",
|
|
597
|
+
"Its address, like https://example.com/plugins/manifest.json. RETURN cancels.": "其地址,例如 https://example.com/plugins/manifest.json。按 RETURN 取消。",
|
|
589
598
|
"Its address, your API key and what came from it, cleared (your addons stay)": "其地址、你的 API 密钥以及来自它的内容将被清除(你的插件保留)",
|
|
590
599
|
"Its answer was too large": "其响应过大",
|
|
591
600
|
"Its built-in subtitles come with it.": "其内置字幕会一并提供。",
|
|
@@ -852,6 +861,11 @@ I18N.add("zh-CN", {
|
|
|
852
861
|
"Nov": "11月",
|
|
853
862
|
"Now": "现在",
|
|
854
863
|
"Nunito (rounded)": "Nunito(圆体)",
|
|
864
|
+
"Nuvio plugins": "Nuvio 插件",
|
|
865
|
+
"Nuvio plugins are someone else’s code, run on your TV. StremioK keeps them apart from your settings and files, but they can reach any website, they learn which titles you open, and they’re given your TMDB key. StremioK doesn’t check what they find, and gives no help with any particular plugin. Turn them on?": "Nuvio 插件是他人编写的代码,在你的电视上运行。StremioK 会将它们与你的设置和文件隔离,但它们可以访问任何网站,会知道你打开了哪些影片,并会获得你的 TMDB 密钥。StremioK 不会检查它们找到的内容,也不提供任何具体插件的帮助。要开启吗?",
|
|
866
|
+
"Nuvio plugins need a 2017 or newer TV and the sideloaded app.": "Nuvio 插件需要 2017 年或更新的电视,以及手动安装的应用。",
|
|
867
|
+
"Nuvio plugins:": "Nuvio 插件:",
|
|
868
|
+
"Nuvio plugins: repository": "Nuvio 插件:仓库",
|
|
855
869
|
"OK adds one. Where an app is listed more than once, pick the one that opens (Settings › Diagnostics › Installed apps tries them).": "按 OK 添加。如果某个应用出现多次,请选择能打开的那个(可在 设置 › 诊断 › 已安装的应用 中尝试)。",
|
|
856
870
|
"OK for English": "按 OK 显示英语",
|
|
857
871
|
"OK for options": "按 OK 查看选项",
|
|
@@ -881,6 +895,7 @@ I18N.add("zh-CN", {
|
|
|
881
895
|
"OK: find it in your addons": "OK:在你的插件中查找",
|
|
882
896
|
"OK: its cast & more Hold OK: more": "OK:演职人员及更多 长按 OK:更多",
|
|
883
897
|
"OK: play BACK: back": "OK:播放 返回:返回",
|
|
898
|
+
"OK: refresh or remove": "OK:刷新或移除",
|
|
884
899
|
"OK: their movies & series": "OK:其电影和剧集",
|
|
885
900
|
"OMDb API key": "OMDb API 密钥",
|
|
886
901
|
"OMDb key": "OMDb 密钥",
|
|
@@ -893,6 +908,7 @@ I18N.add("zh-CN", {
|
|
|
893
908
|
"Off (asked each time)": "关(每次询问)",
|
|
894
909
|
"Off (not asked yet)": "关(尚未询问)",
|
|
895
910
|
"Off — its channels aren’t shown": "关:不显示其频道",
|
|
911
|
+
"Off: no plugin runs": "关:不运行任何插件",
|
|
896
912
|
"On": "开",
|
|
897
913
|
"On YouTube: “{title}”": "YouTube 上:“{title}”",
|
|
898
914
|
"On your Emby server": "在你的 Emby 服务器上",
|
|
@@ -978,6 +994,8 @@ I18N.add("zh-CN", {
|
|
|
978
994
|
"Plays through StremioK’s YouTube service": "经由 StremioK 的 YouTube 服务播放",
|
|
979
995
|
"Plug a USB drive into the TV first": "请先将 USB 驱动器插入电视",
|
|
980
996
|
"Plug in the USB drive with “{name}”": "请插入存有“{name}”的 USB 驱动器",
|
|
997
|
+
"Plugins look titles up by their TMDB number: add a TMDB key in Settings › Content › Integrations.": "插件按 TMDB 编号查找影片:请在 设置 › 内容 › 集成 中添加 TMDB 密钥。",
|
|
998
|
+
"Plugins run slower on this TV than on 2021 and newer ones (one at a time).": "插件在这台电视上的运行速度比 2021 年及更新的电视慢(逐个运行)。",
|
|
981
999
|
"Poland": "波兰",
|
|
982
1000
|
"Polish": "波兰语",
|
|
983
1001
|
"Poor": "较差",
|
|
@@ -1002,6 +1020,7 @@ I18N.add("zh-CN", {
|
|
|
1002
1020
|
"Private viewing: not tracked": "隐私观看:不记录",
|
|
1003
1021
|
"Private viewing: not tracked from now on": "隐私观看:从现在起不记录",
|
|
1004
1022
|
"Private:": "隐私:",
|
|
1023
|
+
"Programs written for the Nuvio apps that look for sources: someone else’s code, run on your TV": "为 Nuvio 应用编写、用于查找片源的程序:他人编写的代码,在你的电视上运行",
|
|
1005
1024
|
"Punjabi": "旁遮普语",
|
|
1006
1025
|
"Put back": "放回",
|
|
1007
1026
|
"Put back among the sources": "放回片源列表",
|
|
@@ -1027,6 +1046,7 @@ I18N.add("zh-CN", {
|
|
|
1027
1046
|
"Reading playlists… {n} channels": "正在读取播放列表… {n} 个频道",
|
|
1028
1047
|
"Reading the TV guide…": "正在读取节目单…",
|
|
1029
1048
|
"Reading the portal…": "正在读取门户…",
|
|
1049
|
+
"Reading the repository…": "正在读取仓库…",
|
|
1030
1050
|
"Reading the whole portal: this can take many minutes, leave StremioK open": "正在读取整个门户:可能需要很多分钟,请保持 StremioK 打开",
|
|
1031
1051
|
"Reading this TV's apps…": "正在读取此电视上的应用…",
|
|
1032
1052
|
"Reading your AIOManager addons…": "正在读取你的 AIOManager 插件…",
|
|
@@ -1056,6 +1076,7 @@ I18N.add("zh-CN", {
|
|
|
1056
1076
|
"Remove rating": "移除评分",
|
|
1057
1077
|
"Remove the YouTube catalog “{name}”?": "移除 YouTube 目录“{name}”?",
|
|
1058
1078
|
"Remove the YouTubio addon? Its catalogs are in your YouTube now.": "移除 YouTubio 插件?其目录现已在你的 YouTube 中。",
|
|
1079
|
+
"Remove “{name}” and its plugins?": "移除“{name}”及其插件?",
|
|
1059
1080
|
"Remove “{name}”? Its index goes too; the folder itself isn’t touched.": "移除“{name}”?其索引也将移除;文件夹本身不受影响。",
|
|
1060
1081
|
"Remove “{q}” from recent searches?": "从最近搜索中移除“{q}”?",
|
|
1061
1082
|
"Removed": "已移除",
|
|
@@ -1066,6 +1087,7 @@ I18N.add("zh-CN", {
|
|
|
1066
1087
|
"Rename IPTV playlist": "重命名 IPTV 播放列表",
|
|
1067
1088
|
"Rename YouTube catalog": "重命名 YouTube 目录",
|
|
1068
1089
|
"Repacking this channel’s sound…": "正在重新封装此频道的声音…",
|
|
1090
|
+
"Repositories come only from addresses you add. Their sources show with your addons’ (From: Nuvio plugins). The plugin format is the Nuvio project’s; StremioK isn’t affiliated with it.": "仓库只来自你添加的地址。其片源会与你的插件的片源一同显示(来自:Nuvio 插件)。插件格式属于 Nuvio 项目;StremioK 与其无关联。",
|
|
1069
1091
|
"Reset": "重置",
|
|
1070
1092
|
"Reset (as in the file)": "重置(与文件中一致)",
|
|
1071
1093
|
"Resolution": "分辨率",
|
|
@@ -1081,7 +1103,7 @@ I18N.add("zh-CN", {
|
|
|
1081
1103
|
"Retry": "重试",
|
|
1082
1104
|
"Retrying with Auto quality…": "正在以自动画质重试…",
|
|
1083
1105
|
"Rewind 10′": "后退 10′",
|
|
1084
|
-
"Rewind 5′": "后退 5
|
|
1106
|
+
"Rewind 5′": "后退 5′",
|
|
1085
1107
|
"Romance": "爱情",
|
|
1086
1108
|
"Romania": "罗马尼亚",
|
|
1087
1109
|
"Romanian": "罗马尼亚语",
|
|
@@ -1319,7 +1341,7 @@ I18N.add("zh-CN", {
|
|
|
1319
1341
|
"TV guide: {channels}, {programs} programs": "节目单:{channels},{programs} 个节目",
|
|
1320
1342
|
"TV guide: {why}": "节目单:{why}",
|
|
1321
1343
|
"TV storage": "电视存储",
|
|
1322
|
-
"Taiwan": "
|
|
1344
|
+
"Taiwan": "中国台湾",
|
|
1323
1345
|
"Talk": "访谈",
|
|
1324
1346
|
"Tamil": "泰米尔语",
|
|
1325
1347
|
"Tatar": "鞑靼语",
|
|
@@ -1608,6 +1630,7 @@ I18N.add("zh-CN", {
|
|
|
1608
1630
|
"Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running).": "你的手机暂时无法连接电视(没有家庭网络,或 StremioK 服务未运行)。",
|
|
1609
1631
|
"Your phone can’t reach the TV just now (no home network, or StremioK’s service isn’t running): type it instead.": "你的手机暂时无法连接电视(没有家庭网络,或 StremioK 服务未运行):请直接输入。",
|
|
1610
1632
|
"Your phone has it: copy or download it there, then Done.": "文件已在你的手机上:请在手机上复制或下载,然后点击完成。",
|
|
1633
|
+
"Your plugins look for sources on title pages": "你的插件会在影片页面上查找片源",
|
|
1611
1634
|
"Your rating: {n} · change": "你的评分:{n} · 更改",
|
|
1612
1635
|
"Your settings ({n} part)": "你的设置({n} 部分)",
|
|
1613
1636
|
"Your settings ({n} parts)": "你的设置({n} 部分)",
|
|
@@ -1687,6 +1710,7 @@ I18N.add("zh-CN", {
|
|
|
1687
1710
|
"no answer (connection refused, blocked or certificate)": "无响应(连接被拒绝、被阻止或证书问题)",
|
|
1688
1711
|
"no longer used: {why}": "已不再使用:{why}",
|
|
1689
1712
|
"no sources for this": "没有片源",
|
|
1713
|
+
"not a plugin repository (no list of plugins)": "不是插件仓库(没有插件列表)",
|
|
1690
1714
|
"not on this TV any more": "已不在此电视上",
|
|
1691
1715
|
"not one of the drives kept": "不在保留的驱动器中",
|
|
1692
1716
|
"not out yet": "尚未上线",
|
|
@@ -1759,6 +1783,7 @@ I18N.add("zh-CN", {
|
|
|
1759
1783
|
"unknown error": "未知错误",
|
|
1760
1784
|
"until {date}": "截至 {date}",
|
|
1761
1785
|
"up to date": "已是最新",
|
|
1786
|
+
"up to {n} repositories": "最多 {n} 个仓库",
|
|
1762
1787
|
"up to {size}": "最大 {size}",
|
|
1763
1788
|
"up to {size} an hour": "每小时最多 {size}",
|
|
1764
1789
|
"user name": "用户名",
|
|
@@ -1813,6 +1838,8 @@ I18N.add("zh-CN", {
|
|
|
1813
1838
|
"{n} changes waiting to reach Trakt": "{n} 项更改待同步到 Trakt",
|
|
1814
1839
|
"{n} channel": "{n} 个频道",
|
|
1815
1840
|
"{n} channels": "{n} 个频道",
|
|
1841
|
+
"{n} didn’t come (kept as it was)": "有 {n} 个未到达(保持原样)",
|
|
1842
|
+
"{n} didn’t come (kept as they were)": "有 {n} 个未到达(保持原样)",
|
|
1816
1843
|
"{n} group chosen": "已选择 {n} 个分组",
|
|
1817
1844
|
"{n} groups chosen": "已选择 {n} 个分组",
|
|
1818
1845
|
"{n} matched to titles": "{n} 个已匹配到影片",
|
|
@@ -1831,6 +1858,8 @@ I18N.add("zh-CN", {
|
|
|
1831
1858
|
"{n} playlist": "{n} 个播放列表",
|
|
1832
1859
|
"{n} playlist(s) reported an error.": "{n} 个播放列表报告了错误。",
|
|
1833
1860
|
"{n} playlists": "{n} 个播放列表",
|
|
1861
|
+
"{n} plugin": "{n} 个插件",
|
|
1862
|
+
"{n} plugins": "{n} 个插件",
|
|
1834
1863
|
"{n} refreshed": "已刷新 {n} 个",
|
|
1835
1864
|
"{n} removed": "已移除 {n} 个",
|
|
1836
1865
|
"{n} result for “{q}”": "“{q}”的 {n} 个结果",
|
|
@@ -1887,12 +1916,14 @@ I18N.add("zh-CN", {
|
|
|
1887
1916
|
"“{name}”: a plain file": "“{name}”:普通文件",
|
|
1888
1917
|
"“{name}”: every episode of the show follows.": "“{name}”:该剧集的所有集都将跟随此设置。",
|
|
1889
1918
|
"“{name}”: no title’s": "“{name}”:不属于任何影片",
|
|
1919
|
+
"“{name}”: {added} new, {changed} changed": "“{name}”:新增 {added} 个,变更 {changed} 个",
|
|
1890
1920
|
"“{url}”: trust this certificate? It isn’t from a known authority (one the folder made itself?)": "“{url}”:信任此证书?它并非来自已知的颁发机构(可能是该文件夹自签的?)",
|
|
1891
1921
|
"← Back": "← 返回",
|
|
1892
1922
|
"↺ Restart": "↺ 重新开始",
|
|
1893
1923
|
"↻ Re-scan for sources": "↻ 重新搜索片源",
|
|
1894
1924
|
"↻ Sync with AIOManager": "↻ 与 AIOManager 同步",
|
|
1895
1925
|
"↻ Try again": "↻ 重试",
|
|
1926
|
+
"↻ Refresh": "↻ 刷新",
|
|
1896
1927
|
"↻ Refresh the {n} addon you have from AIOManager": "↻ 刷新来自 AIOManager 的 {n} 个插件",
|
|
1897
1928
|
"↻ Refresh the {n} addons you have from AIOManager": "↻ 刷新来自 AIOManager 的 {n} 个插件",
|
|
1898
1929
|
"⇧ Export to your phone": "⇧ 导出到你的手机",
|
package/js/player-core.js
CHANGED
|
@@ -474,7 +474,10 @@ var PlayerParts = {};
|
|
|
474
474
|
|
|
475
475
|
engineFor(ctx); // (the TV's player, or a ClearKey channel's own: see startShaka)
|
|
476
476
|
// (a TorrServer torrent that doesn't say which of its files: its file list asked for first)
|
|
477
|
-
var go = function () {
|
|
477
|
+
var go = function () {
|
|
478
|
+
if (fileViaService(ctx)) { startFileRelay(ctx, settle); return; }
|
|
479
|
+
if (useAV) { startLive(ctx, settle); } else { startHTML5(ctx.url); }
|
|
480
|
+
};
|
|
478
481
|
if (ctx.stream && ctx.stream._pickFile && typeof Stremio !== 'undefined' && Stremio.torrentFile) {
|
|
479
482
|
// (the source before stopped first: its callbacks are about it, not this one)
|
|
480
483
|
++_playToken; _openedAt = 0;
|
|
@@ -1463,6 +1466,33 @@ var PlayerParts = {};
|
|
|
1463
1466
|
startAV(ctx.url, settle);
|
|
1464
1467
|
}, function () { if (S.ctx === ctx && S.active) { startAV(ctx.url, settle); } });
|
|
1465
1468
|
}
|
|
1469
|
+
// A file (not HLS) through the service's file relay (/live/file): when it needs headers the
|
|
1470
|
+
// TV's player can't send (Origin, Accept, Accept-Language; under TizenBrew the page's player
|
|
1471
|
+
// sends none), or hold OK on it (ctx.viaService). Each request goes on with its headers and the
|
|
1472
|
+
// player's byte range. Not YouTube, DRM, USB files or the service's own links; redirects into
|
|
1473
|
+
// the home network as Local-network links from internet addons says; the service not
|
|
1474
|
+
// answering: as it is.
|
|
1475
|
+
function fileViaService(ctx) {
|
|
1476
|
+
if (!ctx || ctx._relay || ctx.yt || ctx.trailer || ctx.localFile || (ctx.stream && ctx.stream._drm)) { return false; }
|
|
1477
|
+
if (typeof YTPlay === 'undefined' || !YTPlay.fileOpen || YTPlay.installMode() === 'browser') { return false; }
|
|
1478
|
+
var url = ctx.url || '';
|
|
1479
|
+
if (!/^https?:\/\//i.test(url) || /^http:\/\/(localhost|127\.0\.0\.1)[:\/]/i.test(url)) { return false; }
|
|
1480
|
+
if (HLS_LINK.test(url) || (ctx.formatInfo && ctx.formatInfo.container === 'hls') || /\.mpd(?:[?#]|$)/i.test(url)) { return false; }
|
|
1481
|
+
if (ctx.viaService) { return true; }
|
|
1482
|
+
var h = U.sanitizeHeaders(ctx._headers);
|
|
1483
|
+
return !!h && (!useAV || !!(h.origin || h.accept || h.lang));
|
|
1484
|
+
}
|
|
1485
|
+
function startFileRelay(ctx, settle) {
|
|
1486
|
+
var lan = typeof Stremio !== 'undefined' && Stremio.getPrefs ? !!Stremio.getPrefs().allowLocal : false;
|
|
1487
|
+
function go() {
|
|
1488
|
+
if (S.ctx !== ctx || !S.active) { return; }
|
|
1489
|
+
if (useAV) { startLive(ctx, settle); } else { startHTML5(ctx._relay && ctx._relayFor === ctx.url ? ctx._relay : ctx.url); }
|
|
1490
|
+
}
|
|
1491
|
+
YTPlay.fileOpen(ctx.url, U.sanitizeHeaders(ctx._headers), lan).then(function (r) {
|
|
1492
|
+
if (S.ctx === ctx && S.active && relayed(ctx, r, null, false)) { U.log('player', 'Through StremioK\'s service, with the source\'s headers (' + where(ctx.url) + ')'); }
|
|
1493
|
+
go();
|
|
1494
|
+
}, go);
|
|
1495
|
+
}
|
|
1466
1496
|
function startLive(ctx, settle) {
|
|
1467
1497
|
if (!ctx._relay && viaService(ctx)) { startViaService(ctx, settle); return; }
|
|
1468
1498
|
var known = liveFixable(ctx) ? liveKnown(ctx.url) : null, cc = ccOf(known);
|
package/js/plugins.js
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/* Nuvio plugins (Settings › Content › Nuvio plugins; docs/PLUGINS.md): programs written for the
|
|
2
|
+
Nuvio apps that look for a title's sources. A repository is a manifest.json the user adds by its
|
|
3
|
+
address; it lists plugins, each one JavaScript file (CommonJS) exporting
|
|
4
|
+
getStreams(tmdbId, mediaType, season, episode) -> a promise of sources.
|
|
5
|
+
|
|
6
|
+
Each plugin runs in a fresh QuickJS context inside a Web Worker (js/vendor/quickjs/
|
|
7
|
+
plugin-worker.js, built by plugin-runtime/): nothing of StremioK's inside, its requests through
|
|
8
|
+
the service (/plug/fetch: the home network as Local-network links from internet addons says),
|
|
9
|
+
64 MB, RUN_MS. Only where that can run: see supported() (2017 and newer TVs)
|
|
10
|
+
and StremioK's own service (the sideloaded app); elsewhere the option isn't shown.
|
|
11
|
+
|
|
12
|
+
The code is downloaded on Add and Refresh only, kept in the TV's database (U.bigStore). New
|
|
13
|
+
plugins start off. Plugins are handed the user's TMDB key (they look titles up by TMDB number),
|
|
14
|
+
which Settings says before they're turned on. Their sources come in as a synthetic addon's,
|
|
15
|
+
"Nuvio plugins", placed and ranked like any addon's.
|
|
16
|
+
Global namespace: Plugins */
|
|
17
|
+
var Plugins = (function () {
|
|
18
|
+
'use strict';
|
|
19
|
+
var KEY = 'stremiok.plugins'; // { on, repos: [{ id, url, name, at, plugins: [{ id, name, version, file, types, on, size, hash }] }] }
|
|
20
|
+
var CODE = 'stremiok.plugins.code.'; // + repo id + '.' + plugin id (U.bigStore)
|
|
21
|
+
var MAX_REPOS = 10, MAX_PLUGINS = 50, CODE_MAX = 1048576, MANIFEST_MAX = 262144, RUN_MS = 20000, RUN_MS_LEGACY = 30000, MAX_RESULTS = 100, AT_ONCE = 2, IDLE_MS = 120000;
|
|
22
|
+
var WORKER = 'js/vendor/quickjs/plugin-worker.js', WORKER_LEGACY = 'js/vendor/quickjs/plugin-worker-legacy.js';
|
|
23
|
+
|
|
24
|
+
// Can this TV run them? Two runtimes (js/vendor/quickjs/): WebAssembly for Chromium 76 and later
|
|
25
|
+
// (Tizen 6 on: built for and tried there), and QuickJS as plain JavaScript (-legacy) for older
|
|
26
|
+
// engines, down to Chromium 47 (Tizen 3: tried on a 2017 TV), one plugin at a time with more time.
|
|
27
|
+
// Offered on both; experimental where not tried (Tizen 4, 5.0, 5.5: Chromium 56 to 69). Both
|
|
28
|
+
// need Workers and the sideloaded app's own service (TizenBrew's is shared with other modules:
|
|
29
|
+
// not there yet; a browser has none).
|
|
30
|
+
var MIN_CHROMIUM = 76, MIN_LEGACY = 47, TRIED_LEGACY = 47;
|
|
31
|
+
var TIZEN_CHROMIUM = { '3.0': 47, '4.0': 56, '5.0': 63, '5.5': 69, '6.0': 76, '6.5': 85 };
|
|
32
|
+
function chromium() { // (a Tizen TV says it without "Chrome/": "(KHTML, like Gecko) 76.0.3809.146/6.0 TV"; Tizen 3 not at all)
|
|
33
|
+
var ua = '' + ((typeof navigator !== 'undefined' && navigator.userAgent) || '');
|
|
34
|
+
var m = /Chrome\/(\d+)\./.exec(ua) || /\(KHTML, like Gecko\) (\d+)\.\d+\.\d+/.exec(ua), t = /Tizen (\d+\.\d+)/.exec(ua);
|
|
35
|
+
return m ? +m[1] : t && TIZEN_CHROMIUM[t[1]] ? TIZEN_CHROMIUM[t[1]] : 0;
|
|
36
|
+
}
|
|
37
|
+
function legacy() { return !(chromium() >= MIN_CHROMIUM && typeof WebAssembly === 'object'); }
|
|
38
|
+
function workerFile() { return legacy() ? WORKER_LEGACY : WORKER; }
|
|
39
|
+
function supported() {
|
|
40
|
+
return chromium() >= MIN_LEGACY && typeof Worker === 'function' && typeof YTPlay !== 'undefined' && !!YTPlay.pluginNet && YTPlay.installMode() === 'wgt';
|
|
41
|
+
}
|
|
42
|
+
function experimental() { var c = chromium(); return c > TRIED_LEGACY && c < MIN_CHROMIUM; }
|
|
43
|
+
function runMs() { return legacy() ? RUN_MS_LEGACY : RUN_MS; }
|
|
44
|
+
function state() {
|
|
45
|
+
var s = U.store.get(KEY, null);
|
|
46
|
+
if (!s || typeof s !== 'object') { s = {}; }
|
|
47
|
+
return { on: s.on === true, repos: (Array.isArray(s.repos) ? s.repos : []).filter(function (r) { return r && typeof r.url === 'string' && Array.isArray(r.plugins); }) };
|
|
48
|
+
}
|
|
49
|
+
function save(s) { U.store.set(KEY, { on: !!s.on, repos: s.repos }); }
|
|
50
|
+
function isEnabled() { return supported() && state().on; }
|
|
51
|
+
function setEnabled(on) { var s = state(); s.on = !!on; save(s); reloadAddons(); }
|
|
52
|
+
function repos() { return state().repos; }
|
|
53
|
+
function enabledPlugins() {
|
|
54
|
+
var out = [];
|
|
55
|
+
repos().forEach(function (r) { r.plugins.forEach(function (p) { if (p.on) { out.push({ repo: r, p: p }); } }); });
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
// (the addon list rebuilt with, or without, the plugins' source addon; titles' sources asked again)
|
|
59
|
+
function reloadAddons() {
|
|
60
|
+
if (typeof Stremio === 'undefined') { return; }
|
|
61
|
+
try { if (Stremio.addonsChanged) { Stremio.addonsChanged(); } if (Stremio.sourcesChanged) { Stremio.sourcesChanged(); } } catch (e) {}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// A repository's manifest address from what was typed: its manifest.json, or the folder it's in.
|
|
65
|
+
function manifestUrl(input) {
|
|
66
|
+
var u = ('' + (input || '')).trim();
|
|
67
|
+
if (!/^https?:\/\/[^\s]+$/i.test(u)) { return ''; }
|
|
68
|
+
if (!/\/manifest\.json(?:[?#]|$)/i.test(u)) { u = u.replace(/[?#].*$/, '').replace(/\/+$/, '') + '/manifest.json'; }
|
|
69
|
+
return u;
|
|
70
|
+
}
|
|
71
|
+
function addressProblem(input) { return manifestUrl(input) ? null : U.t('A web address, like https://example.com/plugins/manifest.json'); }
|
|
72
|
+
function resolve(base, rel) {
|
|
73
|
+
rel = '' + rel;
|
|
74
|
+
if (/^https?:\/\//i.test(rel)) { return rel; }
|
|
75
|
+
var origin = /^(https?:\/\/[^\/]+)/i.exec(base)[1];
|
|
76
|
+
if (rel.charAt(0) === '/') { return origin + rel; }
|
|
77
|
+
return base.replace(/[?#].*$/, '').replace(/[^\/]*$/, '') + rel.replace(/^\.\//, '');
|
|
78
|
+
}
|
|
79
|
+
function hashOf(text) { // (FNV-1a: to tell when a plugin's code changed)
|
|
80
|
+
var h = 0x811c9dc5;
|
|
81
|
+
for (var i = 0; i < text.length; i++) { h ^= text.charCodeAt(i); h = (h + ((h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24))) >>> 0; }
|
|
82
|
+
return ('0000000' + h.toString(16)).slice(-8);
|
|
83
|
+
}
|
|
84
|
+
function str(v, max) { return typeof v === 'string' ? v.replace(/[\u0000-\u001f]/g, ' ').trim().slice(0, max) : ''; }
|
|
85
|
+
function idOf(v) { return ('' + v).replace(/[^\w.\-]/g, '_').slice(0, 64); }
|
|
86
|
+
|
|
87
|
+
// A repository read (its manifest, then each plugin's code): { name, plugins: [{…, code}] }.
|
|
88
|
+
function readRepo(url) {
|
|
89
|
+
return U.getJSON(url, 20000, MANIFEST_MAX).then(function (m) {
|
|
90
|
+
var list = m && (Array.isArray(m.scrapers) ? m.scrapers : Array.isArray(m.plugins) ? m.plugins : null);
|
|
91
|
+
if (!list) { throw new Error(U.t('not a plugin repository (no list of plugins)')); }
|
|
92
|
+
list = list.filter(function (x) { return x && x.id && typeof x.filename === 'string'; }).slice(0, MAX_PLUGINS);
|
|
93
|
+
var seen = {};
|
|
94
|
+
list = list.filter(function (x) { var k = idOf(x.id); if (seen[k]) { return false; } seen[k] = true; return true; });
|
|
95
|
+
return Promise.all(list.map(function (x) {
|
|
96
|
+
var types = (Array.isArray(x.supportedTypes) ? x.supportedTypes : ['movie', 'tv']).filter(function (t) { return t === 'movie' || t === 'tv'; });
|
|
97
|
+
var p = { id: idOf(x.id), name: str(x.name, 80) || idOf(x.id), version: str(x.version, 20), file: resolve(url, x.filename), types: types, on: false };
|
|
98
|
+
return U.getText(p.file, 20000, CODE_MAX).then(function (code) { p.code = '' + code; p.size = p.code.length; p.hash = hashOf(p.code); return p; },
|
|
99
|
+
function (e) { p.error = U.problem(e); return p; });
|
|
100
|
+
})).then(function (plugins) { return { name: str(m.name, 80) || url.replace(/^https?:\/\//, '').replace(/\/manifest\.json.*$/i, ''), plugins: plugins }; });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Add a repository (or read it again: refresh), keeping each plugin's on / off. Resolves to
|
|
104
|
+
// { repo, added, changed, failed } (failed: plugins whose code didn't come; kept as they were).
|
|
105
|
+
function saveRepo(url, id) {
|
|
106
|
+
var s = state(), old = null;
|
|
107
|
+
s.repos.forEach(function (r) { if (r.id === id || (!id && r.url === url)) { old = r; } });
|
|
108
|
+
if (!old && s.repos.length >= MAX_REPOS) { return Promise.reject(new Error(U.t('up to {n} repositories', { n: MAX_REPOS }))); }
|
|
109
|
+
return readRepo(url).then(function (got) {
|
|
110
|
+
var rid = old ? old.id : 'r' + Date.now().toString(36);
|
|
111
|
+
var before = {};
|
|
112
|
+
if (old) { old.plugins.forEach(function (p) { before[p.id] = p; }); }
|
|
113
|
+
var added = 0, changed = 0, failed = 0, writes = [];
|
|
114
|
+
var plugins = got.plugins.map(function (p) {
|
|
115
|
+
var was = before[p.id];
|
|
116
|
+
if (p.error) { failed++; return was || null; }
|
|
117
|
+
if (!was) { added++; } else if (was.hash !== p.hash) { changed++; }
|
|
118
|
+
writes.push(U.bigStore.set(CODE + rid + '.' + p.id, p.code));
|
|
119
|
+
return { id: p.id, name: p.name, version: p.version, file: p.file, types: p.types, on: !!(was && was.on), size: p.size, hash: p.hash };
|
|
120
|
+
}).filter(Boolean);
|
|
121
|
+
return Promise.all(writes).then(function () {
|
|
122
|
+
if (old) { old.plugins.forEach(function (p) { if (!plugins.some(function (q) { return q.id === p.id; })) { U.bigStore.remove(CODE + rid + '.' + p.id); } }); }
|
|
123
|
+
var repo = { id: rid, url: url, name: got.name, at: Date.now(), plugins: plugins };
|
|
124
|
+
var s2 = state();
|
|
125
|
+
s2.repos = s2.repos.filter(function (r) { return r.id !== rid; });
|
|
126
|
+
s2.repos.push(repo);
|
|
127
|
+
save(s2);
|
|
128
|
+
reloadAddons();
|
|
129
|
+
return { repo: repo, added: added, changed: changed, failed: failed };
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function addRepo(input) {
|
|
134
|
+
var url = manifestUrl(input);
|
|
135
|
+
if (!url) { return Promise.reject(new Error(addressProblem(input))); }
|
|
136
|
+
return saveRepo(url, null);
|
|
137
|
+
}
|
|
138
|
+
function refreshRepo(id) {
|
|
139
|
+
var r = repos().filter(function (x) { return x.id === id; })[0];
|
|
140
|
+
return r ? saveRepo(r.url, r.id) : Promise.reject(new Error('gone'));
|
|
141
|
+
}
|
|
142
|
+
function removeRepo(id) {
|
|
143
|
+
var s = state();
|
|
144
|
+
s.repos.forEach(function (r) { if (r.id === id) { r.plugins.forEach(function (p) { U.bigStore.remove(CODE + r.id + '.' + p.id); }); } });
|
|
145
|
+
s.repos = s.repos.filter(function (r) { return r.id !== id; });
|
|
146
|
+
save(s);
|
|
147
|
+
reloadAddons();
|
|
148
|
+
}
|
|
149
|
+
function setPlugin(repoId, pluginId, on) {
|
|
150
|
+
var s = state();
|
|
151
|
+
s.repos.forEach(function (r) { if (r.id === repoId) { r.plugins.forEach(function (p) { if (p.id === pluginId) { p.on = !!on; } }); } });
|
|
152
|
+
save(s);
|
|
153
|
+
reloadAddons();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// ---- The Worker (one, kept while in use; gone after IDLE_MS, or when it asks to start over)
|
|
157
|
+
var _worker = null, _waiting = {}, _next = 1, _idle = null;
|
|
158
|
+
function worker() {
|
|
159
|
+
if (_idle) { clearTimeout(_idle); _idle = null; }
|
|
160
|
+
if (_worker) { return _worker; }
|
|
161
|
+
_worker = new Worker(workerFile());
|
|
162
|
+
_worker.onmessage = function (ev) {
|
|
163
|
+
var m = ev.data || {};
|
|
164
|
+
if (m.type === 'restart') { drop(); return; }
|
|
165
|
+
var w = _waiting[m.id];
|
|
166
|
+
if (!w) { return; }
|
|
167
|
+
delete _waiting[m.id];
|
|
168
|
+
clearTimeout(w.timer);
|
|
169
|
+
w.done(m);
|
|
170
|
+
idleLater();
|
|
171
|
+
};
|
|
172
|
+
_worker.onerror = function (e) { U.log('plugins', 'Plugin runtime error: ' + ((e && e.message) || 'unknown')); fail('the plugin runtime stopped'); };
|
|
173
|
+
return _worker;
|
|
174
|
+
}
|
|
175
|
+
function idleLater() { if (!Object.keys(_waiting).length) { _idle = setTimeout(drop, IDLE_MS); } }
|
|
176
|
+
function drop() { if (_worker) { try { _worker.terminate(); } catch (e) {} _worker = null; } }
|
|
177
|
+
function fail(why) { var w = _waiting; _waiting = {}; drop(); Object.keys(w).forEach(function (k) { clearTimeout(w[k].timer); w[k].done({ type: 'failed', why: why, logs: [] }); }); }
|
|
178
|
+
function runOne(code, plugin, args, net) {
|
|
179
|
+
return new Promise(function (resolve) {
|
|
180
|
+
var id = _next++;
|
|
181
|
+
var timer = setTimeout(function () { if (_waiting[id]) { fail('took too long'); } }, runMs() + 5000); // (a runtime that stopped answering: started over)
|
|
182
|
+
_waiting[id] = { done: resolve, timer: timer };
|
|
183
|
+
var tmdbKey = typeof Stremio !== 'undefined' && Stremio.getIntegrations ? (Stremio.getIntegrations().tmdb || '') : '';
|
|
184
|
+
try { worker().postMessage({ type: 'run', id: id, code: code, scraperId: plugin.id, args: args, tmdbKey: tmdbKey, net: net, timeoutMs: runMs(), maxResults: MAX_RESULTS }); }
|
|
185
|
+
catch (e) { delete _waiting[id]; clearTimeout(timer); resolve({ type: 'failed', why: (e && e.message) || 'couldn’t start', logs: [] }); }
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// ---- A title's sources
|
|
190
|
+
function lanAllowed() { return typeof Stremio !== 'undefined' && Stremio.getPrefs ? !!Stremio.getPrefs().allowLocal : false; }
|
|
191
|
+
// A plugin's source as an addon's: plain data, its headers as proxyHeaders (played as an addon's).
|
|
192
|
+
function toSource(x, plugin, n) {
|
|
193
|
+
if (!x || typeof x !== 'object') { return null; }
|
|
194
|
+
var url = typeof x.url === 'string' ? x.url.trim() : '', hash = typeof x.infoHash === 'string' && /^[0-9a-f]{40}$/i.test(x.infoHash) ? x.infoHash.toLowerCase() : '';
|
|
195
|
+
if (!hash && (!/^https?:\/\/[^\s]+$/i.test(url) || url.length > 4096)) { return null; }
|
|
196
|
+
if (url && !lanAllowed() && U.urlIsPrivate && U.urlIsPrivate(url)) { return null; }
|
|
197
|
+
var bits = [str(x.title, 300) || str(x.name, 120)];
|
|
198
|
+
if (str(x.quality, 20)) { bits.push(str(x.quality, 20)); }
|
|
199
|
+
if (str(x.size, 30)) { bits.push(str(x.size, 30)); }
|
|
200
|
+
var s = { name: plugin.name + (str(x.name, 60) && str(x.name, 60) !== plugin.name ? '\n' + str(x.name, 60) : ''), title: bits.filter(Boolean).join('\n'), _plugin: plugin.id, _pluginPos: n };
|
|
201
|
+
if (hash) { s.infoHash = hash; if (typeof x.fileIdx === 'number') { s.fileIdx = x.fileIdx; } } else { s.url = url; }
|
|
202
|
+
var h = x.headers && typeof x.headers === 'object' ? x.headers : (x.behaviorHints && x.behaviorHints.proxyHeaders && x.behaviorHints.proxyHeaders.request);
|
|
203
|
+
var clean = h ? U.sanitizeHeaders(h) : null;
|
|
204
|
+
s.behaviorHints = { notWebReady: true };
|
|
205
|
+
if (clean) {
|
|
206
|
+
s.behaviorHints.proxyHeaders = { request: {} };
|
|
207
|
+
if (clean.ua) { s.behaviorHints.proxyHeaders.request['User-Agent'] = clean.ua; }
|
|
208
|
+
if (clean.ref) { s.behaviorHints.proxyHeaders.request.Referer = clean.ref; }
|
|
209
|
+
if (clean.cookie) { s.behaviorHints.proxyHeaders.request.Cookie = clean.cookie; }
|
|
210
|
+
if (clean.origin) { s.behaviorHints.proxyHeaders.request.Origin = clean.origin; }
|
|
211
|
+
if (clean.accept) { s.behaviorHints.proxyHeaders.request.Accept = clean.accept; }
|
|
212
|
+
if (clean.lang) { s.behaviorHints.proxyHeaders.request['Accept-Language'] = clean.lang; }
|
|
213
|
+
s._headers = clean;
|
|
214
|
+
}
|
|
215
|
+
return s;
|
|
216
|
+
}
|
|
217
|
+
// The TMDB number plugins ask by: in the id (tmdb:…), the title's details, or looked up.
|
|
218
|
+
function tmdbOf(type, id, meta) {
|
|
219
|
+
var m = /^tmdb:(\d+)/.exec(id);
|
|
220
|
+
if (m) { return Promise.resolve(m[1]); }
|
|
221
|
+
var known = meta && (meta.moviedb_id || meta.tmdb_id || (meta.behaviorHints && meta.behaviorHints.tmdbId));
|
|
222
|
+
if (known && /^\d+$/.test('' + known)) { return Promise.resolve('' + known); }
|
|
223
|
+
var imdb = /^(tt\d+)/.exec(id);
|
|
224
|
+
if (!imdb || typeof Stremio === 'undefined' || !Stremio.tmdbFind) { return Promise.resolve(null); }
|
|
225
|
+
return Stremio.tmdbFind(imdb[1], type === 'series' ? 'tv' : 'movie').then(function (n) { return n ? '' + n : null; });
|
|
226
|
+
}
|
|
227
|
+
function streams(type, id, meta) {
|
|
228
|
+
if (!isEnabled()) { return Promise.resolve([]); }
|
|
229
|
+
var kind = type === 'series' ? 'tv' : type === 'movie' ? 'movie' : '';
|
|
230
|
+
var todo = enabledPlugins().filter(function (x) { return kind && x.p.types.indexOf(kind) !== -1; });
|
|
231
|
+
if (!todo.length) { return Promise.resolve([]); }
|
|
232
|
+
var ep = /:(\d+):(\d+)$/.exec(id || '');
|
|
233
|
+
return tmdbOf(type, id || '', meta).then(function (tmdb) {
|
|
234
|
+
if (!tmdb) { U.log('plugins', 'No TMDB number for ' + id + ' (a TMDB key is needed: Settings › Content › Integrations)'); return []; }
|
|
235
|
+
var args = [tmdb, kind, ep ? +ep[1] : null, ep ? +ep[2] : null];
|
|
236
|
+
return YTPlay.pluginNet(lanAllowed()).then(function (net) {
|
|
237
|
+
var out = [];
|
|
238
|
+
return U.settleAll(todo.map(function (x) {
|
|
239
|
+
return function () {
|
|
240
|
+
return U.bigStore.get(CODE + x.repo.id + '.' + x.p.id).then(function (code) {
|
|
241
|
+
if (typeof code !== 'string' || !code) { throw new Error('its code isn’t on the TV: refresh its repository'); }
|
|
242
|
+
return runOne(code, x.p, args, net);
|
|
243
|
+
}).then(function (r) {
|
|
244
|
+
(r.logs || []).slice(0, 20).forEach(function (l) { U.log('plugins', x.p.name + ': ' + l); });
|
|
245
|
+
if (r.type !== 'done') { throw new Error(r.why || 'failed'); }
|
|
246
|
+
var list = (Array.isArray(r.streams) ? r.streams : []).slice(0, MAX_RESULTS).map(function (s, n) { return toSource(s, x.p, n); }).filter(Boolean);
|
|
247
|
+
out = out.concat(list);
|
|
248
|
+
}).then(null, function (e) { U.log('plugins', x.p.name + ' (' + args.slice(0, 2).join(' ') + '): ' + ((e && e.message) || e)); });
|
|
249
|
+
};
|
|
250
|
+
}), legacy() ? 1 : AT_ONCE).then(function () { return out; });
|
|
251
|
+
}, function () { return []; });
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// The synthetic addon its sources come in as ("Nuvio plugins": a source addon, no catalogs)
|
|
256
|
+
var _addon = null;
|
|
257
|
+
function synthAddon() {
|
|
258
|
+
if (!_addon) {
|
|
259
|
+
_addon = { __local: true, __sources: true, __impl: { streams: streams }, url: 'local:plugins', base: 'local:plugins',
|
|
260
|
+
manifest: { id: 'org.stremiok.plugins', name: 'Nuvio plugins', version: '1.0.0', types: ['movie', 'series'], catalogs: [],
|
|
261
|
+
resources: [{ name: 'stream', types: ['movie', 'series'], idPrefixes: ['tt', 'tmdb:'] }] } };
|
|
262
|
+
}
|
|
263
|
+
return _addon;
|
|
264
|
+
}
|
|
265
|
+
function hasSources() { return isEnabled() && enabledPlugins().length > 0; }
|
|
266
|
+
|
|
267
|
+
return { supported: supported, isEnabled: isEnabled, setEnabled: setEnabled, repos: repos, addRepo: addRepo, refreshRepo: refreshRepo, removeRepo: removeRepo,
|
|
268
|
+
setPlugin: setPlugin, addressProblem: addressProblem, manifestUrl: manifestUrl, streams: streams, synthAddon: synthAddon, hasSources: hasSources,
|
|
269
|
+
toSource: toSource, workerFile: workerFile, experimental: experimental, slower: legacy, MAX_REPOS: MAX_REPOS };
|
|
270
|
+
})();
|
package/js/stremio.js
CHANGED
|
@@ -443,6 +443,7 @@ var Stremio = (function () {
|
|
|
443
443
|
else if (iptvOn) { iptvJoin(addons, rev); }
|
|
444
444
|
if (typeof XtVod !== 'undefined' && XtVod.isEnabled()) { addons.push(XtVod.synthAddon()); } // (your Xtream accounts' films and series: after your addons)
|
|
445
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)
|
|
446
447
|
if (typeof Jellyfin !== 'undefined') { Jellyfin.synthAddons().forEach(function (a) { addons.push(a); }); } // (your Jellyfin and Emby servers' libraries: one addon a kind)
|
|
447
448
|
if (typeof Plex !== 'undefined') { Plex.synthAddons().forEach(function (a) { addons.push(a); }); } // (your Plex servers')
|
|
448
449
|
if (hasYouTube()) { addons.push(YouTube.synthAddon()); } // (after your addons: its rows last on Home)
|
|
@@ -2408,7 +2409,7 @@ var Stremio = (function () {
|
|
|
2408
2409
|
addonUrlProblem: function (v) { return U.urlProblem(v); },
|
|
2409
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,
|
|
2410
2411
|
getIntegrations: getIntegrations, setIntegration: setIntegration, getPrefs: getPrefs, setPref: setPref, addonLogo: addonLogo,
|
|
2411
|
-
getIntroSegments: getIntroSegments,
|
|
2412
|
+
getIntroSegments: getIntroSegments, tmdbFind: tmdbFind,
|
|
2412
2413
|
tmdbValidate: tmdbValidate, mdblistValidate: mdblistValidate, omdbValidate: omdbValidate,
|
|
2413
2414
|
tmdbFindTvId: tmdbFindTvId, tmdbSeasonEpisodes: tmdbSeasonEpisodes, tmdbImg: tmdbImg,
|
|
2414
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(); },
|
|
@@ -2420,7 +2421,7 @@ var Stremio = (function () {
|
|
|
2420
2421
|
getMeta: getMeta, getStreams: getStreams, prefetchStreams: prefetchStreams, dedupeStreams: dedupeStreams,
|
|
2421
2422
|
getSubtitles: getSubtitles,
|
|
2422
2423
|
getSearchCatalogs: getSearchCatalogs, findTitles: findTitles,
|
|
2423
|
-
addonsChanged: function () { _loaded = null; }, // (StremioK's own YouTube catalogs changed)
|
|
2424
|
+
addonsChanged: function () { _loaded = null; }, sourcesChanged: sourcesChanged, // (StremioK's own YouTube catalogs changed)
|
|
2424
2425
|
setAllowLocal: function (on) { setPref('allowLocal', !!on); var kept = _loaded; configChanged(); _loaded = kept; },
|
|
2425
2426
|
getRanking: getRanking, moveRanking: moveRanking, toggleRanking: toggleRanking,
|
|
2426
2427
|
setPlayedFirst: setPlayedFirst, resetRanking: resetRanking,
|
package/js/util.js
CHANGED
|
@@ -398,12 +398,21 @@ var U = (function () {
|
|
|
398
398
|
var ua = headerValue(h.ua != null ? h.ua : (h['User-Agent'] || h['user-agent']), HEADER_MAX.ua);
|
|
399
399
|
var ref = headerValue(h.ref != null ? h.ref : (h.Referer || h.referer), HEADER_MAX.ref);
|
|
400
400
|
var cookie = headerValue(h.cookie != null ? h.cookie : (h.Cookie || h.COOKIE), HEADER_MAX.cookie);
|
|
401
|
+
// (and three the TV's player can't send, played through the service: see player-core's
|
|
402
|
+
// fileViaService) an Origin is a site's address alone
|
|
403
|
+
var origin = headerValue(h.origin != null ? h.origin : (h.Origin || h.ORIGIN), HEADER_MAX.ref);
|
|
404
|
+
var accept = headerValue(h.accept != null ? h.accept : (h.Accept || h.ACCEPT), HEADER_MAX.ua);
|
|
405
|
+
var lang = headerValue(h.lang != null ? h.lang : (h['Accept-Language'] || h['accept-language']), HEADER_MAX.ua);
|
|
401
406
|
if (ref && !/^https?:\/\/[^\s]+$/i.test(ref)) { ref = ''; }
|
|
402
|
-
if (
|
|
407
|
+
if (origin && !/^https?:\/\/[^\s\/?#]+$/i.test(origin)) { origin = ''; }
|
|
408
|
+
if (!ua && !ref && !cookie && !origin && !accept && !lang) { return null; }
|
|
403
409
|
var out = {};
|
|
404
410
|
if (ua) { out.ua = ua; }
|
|
405
411
|
if (ref) { out.ref = ref; }
|
|
406
412
|
if (cookie) { out.cookie = cookie; }
|
|
413
|
+
if (origin) { out.origin = origin; }
|
|
414
|
+
if (accept) { out.accept = accept; }
|
|
415
|
+
if (lang) { out.lang = lang; }
|
|
407
416
|
return out;
|
|
408
417
|
}
|
|
409
418
|
|