@oxymoron.13/tizentube-s95b 0.2.2 → 0.2.3

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.
Files changed (84) hide show
  1. package/README.md +49 -42
  2. package/S95B-CHANGES.txt +10 -4
  3. package/UPSTREAM-README.md +42 -0
  4. package/dist/userScript.js +2 -2
  5. package/mods/config.js +117 -0
  6. package/mods/domrect-polyfill.js +104 -0
  7. package/mods/features/adblock.js +584 -0
  8. package/mods/features/autoFrameRate.js +42 -0
  9. package/mods/features/enableFeatures.js +19 -0
  10. package/mods/features/moreSubtitles.js +378 -0
  11. package/mods/features/pictureInPicture.js +198 -0
  12. package/mods/features/preferredVideoQuality.js +101 -0
  13. package/mods/features/s95bCodec.js +45 -0
  14. package/mods/features/s95bI18n.js +28 -0
  15. package/mods/features/s95bMenu.js +142 -0
  16. package/mods/features/sponsorblock.js +437 -0
  17. package/mods/features/standaloneUserscript.js +107 -0
  18. package/mods/features/updater.js +119 -0
  19. package/mods/features/userAgentSpoofing.js +73 -0
  20. package/mods/features/videoQueuing.js +64 -0
  21. package/mods/package-lock.json +2321 -0
  22. package/mods/package.json +33 -0
  23. package/mods/resolveCommand.js +376 -0
  24. package/mods/rollup.config.js +41 -0
  25. package/mods/spatial-navigation-polyfill.js +1756 -0
  26. package/mods/tiny-sha256.js +99 -0
  27. package/mods/translations/i18nResources.js +11 -0
  28. package/mods/translations/index.js +18 -0
  29. package/mods/translations/language-names.js +981 -0
  30. package/mods/translations/resources/ar.json +308 -0
  31. package/mods/translations/resources/az.json +308 -0
  32. package/mods/translations/resources/bs.json +308 -0
  33. package/mods/translations/resources/cs.json +308 -0
  34. package/mods/translations/resources/de.json +308 -0
  35. package/mods/translations/resources/dk.json +308 -0
  36. package/mods/translations/resources/el.json +308 -0
  37. package/mods/translations/resources/en.json +308 -0
  38. package/mods/translations/resources/es-419.json +308 -0
  39. package/mods/translations/resources/es.json +308 -0
  40. package/mods/translations/resources/fi-FI.json +308 -0
  41. package/mods/translations/resources/fr.json +311 -0
  42. package/mods/translations/resources/hr.json +308 -0
  43. package/mods/translations/resources/hu.json +308 -0
  44. package/mods/translations/resources/id.json +308 -0
  45. package/mods/translations/resources/it.json +308 -0
  46. package/mods/translations/resources/ja.json +308 -0
  47. package/mods/translations/resources/lt.json +308 -0
  48. package/mods/translations/resources/lv.json +308 -0
  49. package/mods/translations/resources/pl.json +308 -0
  50. package/mods/translations/resources/pt-BR.json +308 -0
  51. package/mods/translations/resources/pt-PT.json +308 -0
  52. package/mods/translations/resources/ro.json +310 -0
  53. package/mods/translations/resources/ru.json +308 -0
  54. package/mods/translations/resources/sr-Cyrl.json +308 -0
  55. package/mods/translations/resources/sr-Latn.json +308 -0
  56. package/mods/translations/resources/tlh.json +308 -0
  57. package/mods/translations/resources/tr.json +308 -0
  58. package/mods/translations/resources/uk.json +308 -0
  59. package/mods/translations/resources/vi.json +309 -0
  60. package/mods/translations/resources/zh-CN.json +308 -0
  61. package/mods/translations/resources/zh-TW.json +308 -0
  62. package/mods/translations/update-translations.js +55 -0
  63. package/mods/ui/chapters.js +137 -0
  64. package/mods/ui/clock.js +71 -0
  65. package/mods/ui/customCommandExecution.js +49 -0
  66. package/mods/ui/customGuideAction.js +119 -0
  67. package/mods/ui/customUI.js +192 -0
  68. package/mods/ui/customYTSettings.js +29 -0
  69. package/mods/ui/disableWhosWatching.js +48 -0
  70. package/mods/ui/settings.js +1024 -0
  71. package/mods/ui/sidebarModification.js +179 -0
  72. package/mods/ui/speedUI.js +119 -0
  73. package/mods/ui/theme.js +26 -0
  74. package/mods/ui/ui.css +157 -0
  75. package/mods/ui/ui.js +261 -0
  76. package/mods/ui/ytUI.js +510 -0
  77. package/mods/userScript.js +28 -0
  78. package/mods/utils/ASTParser.js +67 -0
  79. package/mods/utils/innerTubeCalls.js +138 -0
  80. package/package.json +11 -5
  81. package/service/package-lock.json +4193 -0
  82. package/service/package.json +29 -0
  83. package/service/rollup.config.js +47 -0
  84. package/service/service.js +118 -0
@@ -0,0 +1,138 @@
1
+ import resolveCommand from '../resolveCommand.js';
2
+
3
+ function requestNextAndNavigateChannel(params) {
4
+ const mappings = Object.values(window._yttv).find(a => a && a.mappings);
5
+ const CurrentIdentityService = mappings.get('CurrentIdentityService');
6
+ const KabukiInnerTubeClient = mappings.get('KabukiInnerTubeClient');
7
+ const videoId = params.tileRenderer ? params.tileRenderer.contentId : params.lockupViewModel.contentId;
8
+ const paramsValue = params.tileRenderer ? params.tileRenderer.onSelectCommand.watchEndpoint.params : params.lockupViewModel.rendererContext.commandContext.onTap.innertubeCommand.watchEndpoint.params;
9
+ const randomDelay = Math.floor(Math.random() * 2000);
10
+
11
+ CurrentIdentityService.get().then(identity => {
12
+ const request = {
13
+ identity,
14
+ isPrefetch: false,
15
+ path: '/youtubei/v1/next',
16
+ payload: {
17
+ videoId,
18
+ params: paramsValue,
19
+ racyCheckOk: true,
20
+ contentCheckOk: true,
21
+ playbackContext: {
22
+ lactMilliseconds: randomDelay,
23
+ isLyricsMode: false
24
+ },
25
+ autonavState: 'STATE_NONE',
26
+ mdxContext: {
27
+ mdxReceiverContext: {
28
+ mdxConnectedDevices: []
29
+ }
30
+ }
31
+ },
32
+ clickTracking: {
33
+ clickTrackingParams: null,
34
+ }
35
+ }
36
+
37
+ KabukiInnerTubeClient.fetch(request).subscribe((response) => {
38
+ const contents = response?.contents?.singleColumnWatchNextResults?.results?.results?.contents;
39
+ if (contents) {
40
+ const itemSectionRenderer = contents.find(item => item.itemSectionRenderer);
41
+ const videoMetadataRenderer = itemSectionRenderer?.itemSectionRenderer?.contents?.find(item => item.videoMetadataRenderer);
42
+ if (videoMetadataRenderer) {
43
+ const navigation = videoMetadataRenderer.videoMetadataRenderer?.owner?.videoOwnerRenderer?.navigationEndpoint;
44
+ if (navigation) resolveCommand(navigation);
45
+ }
46
+ }
47
+ });
48
+ });
49
+ }
50
+
51
+ function getGuide() {
52
+ const mappings = Object.values(window._yttv).find(a => a && a.mappings);
53
+ const KabukiInnerTubeClient = mappings.get('KabukiInnerTubeClient');
54
+
55
+ const request = {
56
+ path: '/youtubei/v1/guide'
57
+ };
58
+
59
+ return new Promise((resolve, _) => {
60
+ KabukiInnerTubeClient.fetch(request).subscribe((response) => {
61
+ resolve(response);
62
+ });
63
+ });
64
+ }
65
+
66
+ // Recursively find a feedbackToken inside a (possibly nested) innertube command.
67
+ // The "Not interested" / "Don't recommend channel" panel items carry their token either
68
+ // directly (onTap.innertubeCommand.feedbackEndpoint) or wrapped in an openPopupAction
69
+ // (onTap.innertubeCommand.openPopupAction...commandExecutorCommand.commands[].feedbackEndpoint).
70
+ function findFeedbackToken(obj) {
71
+ if (!obj || typeof obj !== 'object') return null;
72
+ if (typeof obj.feedbackToken === 'string') return obj.feedbackToken;
73
+ for (const value of Object.values(obj)) {
74
+ const token = findFeedbackToken(value);
75
+ if (token) return token;
76
+ }
77
+ return null;
78
+ }
79
+
80
+ // YouTube moved the feedback tokens out of the long press menu into an engagement
81
+ // panel (panelId + params). Fetch the panel and return its feedback tokens in order:
82
+ // [0] = "Not interested", [1] = "Don't recommend channel".
83
+ function getFeedbackPanelTokens(panelId, params) {
84
+ const mappings = Object.values(window._yttv).find(a => a && a.mappings);
85
+ const KabukiInnerTubeClient = mappings.get('KabukiInnerTubeClient');
86
+
87
+ const request = {
88
+ path: '/youtubei/v1/get_panel',
89
+ payload: {
90
+ panelId,
91
+ params
92
+ }
93
+ };
94
+
95
+ return new Promise((resolve, reject) => {
96
+ KabukiInnerTubeClient.fetch(request).subscribe((response) => {
97
+ const listItems = response?.content?.engagementPanelSectionListRenderer?.content?.listViewModel?.listItems;
98
+ if (!Array.isArray(listItems)) {
99
+ resolve([]);
100
+ return;
101
+ }
102
+ resolve(
103
+ listItems
104
+ .map((item) => findFeedbackToken(item?.listItemViewModel))
105
+ .filter(Boolean)
106
+ );
107
+ }, reject);
108
+ });
109
+ }
110
+
111
+ // Send a feedback token (e.g. "Not interested" / "Don't recommend channel") to YouTube.
112
+ // The response may contain a followUpDialog with dismissal reasons that should be
113
+ // presented to the user (see markFeedback in resolveCommand.js).
114
+ function sendFeedbackToken(feedbackToken) {
115
+ const mappings = Object.values(window._yttv).find(a => a && a.mappings);
116
+ const KabukiInnerTubeClient = mappings.get('KabukiInnerTubeClient');
117
+
118
+ const request = {
119
+ path: '/youtubei/v1/feedback',
120
+ payload: {
121
+ feedbackTokens: [feedbackToken]
122
+ }
123
+ };
124
+
125
+ return new Promise((resolve, reject) => {
126
+ KabukiInnerTubeClient.fetch(request).subscribe((response) => {
127
+ resolve(response);
128
+ }, reject);
129
+ });
130
+ }
131
+
132
+ export {
133
+ requestNextAndNavigateChannel,
134
+ getGuide,
135
+ findFeedbackToken,
136
+ getFeedbackPanelTokens,
137
+ sendFeedbackToken
138
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@oxymoron.13/tizentube-s95b",
3
- "appName": "TizenTube S95B Performance",
4
- "version": "0.2.2",
5
- "description": "TizenTube fork with reversible S95B performance profile and German/English settings",
3
+ "appName": "TizenTube S95B Performance (Fork)",
4
+ "version": "0.2.3",
5
+ "description": "Unofficial fork of TizenTube (@foxreis/tizentube) for TizenBrew: reversible performance profile, German/English settings, smaller bundle.",
6
6
  "packageType": "mods",
7
7
  "websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
8
8
  "main": "dist/userScript.js",
9
- "author": "Reis Can; S95B Performance Edition contributors",
9
+ "author": "S95B Performance Edition contributors (unofficial fork of TizenTube by Reis Can)",
10
10
  "serviceFile": "dist/service.js",
11
11
  "keys": [
12
12
  "MediaPlayPause",
@@ -19,5 +19,11 @@
19
19
  "MediaTrackPrevious",
20
20
  "ColorF2Yellow"
21
21
  ],
22
- "license": "GPL-3.0-only"
22
+ "license": "GPL-3.0-only",
23
+ "keywords": [
24
+ "tizenbrew",
25
+ "tizentube",
26
+ "tizen",
27
+ "unofficial-fork"
28
+ ]
23
29
  }