@oxymoron.13/tizentube-s95b 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +49 -42
  2. package/S95B-CHANGES.txt +9 -3
  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 +34 -0
  15. package/mods/features/s95bMenu.js +223 -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,73 @@
1
+ const deviceProfiles = [
2
+ {
3
+ architecture: 'Linux arm64-v8a',
4
+ os: 'Android 10',
5
+ rasterizer: 'gles',
6
+ manufacturer: 'Sony',
7
+ deviceType: 'ATV',
8
+ chipsetModel: 'sdm845',
9
+ modelYear: 13140765,
10
+ firmwareVersion: '52.1.C.0.268',
11
+ brand: 'KDDI',
12
+ model: 'SOV38'
13
+ },
14
+ {
15
+ architecture: 'Linux armeabi-v7a',
16
+ os: 'Android 14',
17
+ rasterizer: 'gles',
18
+ manufacturer: 'Google',
19
+ deviceType: 'ATV',
20
+ chipsetModel: 'sabrina',
21
+ modelYear: 2020,
22
+ firmwareVersion: 'UTTC.250917.004',
23
+ brand: 'google',
24
+ model: 'Chromecast'
25
+ },
26
+ {
27
+ architecture: 'Linux armeabi-v7a',
28
+ os: 'Android 12',
29
+ rasterizer: 'gles',
30
+ manufacturer: 'TCL',
31
+ deviceType: 'ATV',
32
+ chipsetModel: 'merak',
33
+ modelYear: 2023,
34
+ firmwareVersion: 'STT2.221228.001',
35
+ brand: 'TCL',
36
+ model: 'Smart TV Pro'
37
+ },
38
+ {
39
+ architecture: 'Linux armeabi-v7a',
40
+ os: 'Android 7.1.2',
41
+ rasterizer: 'gles',
42
+ manufacturer: 'Amazon',
43
+ deviceType: 'ATV',
44
+ chipsetModel: 'mt8695',
45
+ modelYear: 0,
46
+ firmwareVersion: 'NS6294',
47
+ brand: 'Amazon',
48
+ model: 'AFTMM'
49
+ }
50
+ ]
51
+
52
+ const cobaltVersion = '25.lts.30.1034958-gold';
53
+ const v8Version = 'v8/8.8.278.17-jit';
54
+ const starboardVersion = '15';
55
+ const auxField = 'com.google.android.youtube.tv/5.30.301';
56
+
57
+ function generateUserAgent(profile) {
58
+ return `Mozilla/5.0 (${profile.architecture}; ${profile.os}) Cobalt/${cobaltVersion} (unlike Gecko) ${v8Version} ${profile.rasterizer} Starboard/${starboardVersion}, ${profile.manufacturer}_${profile.deviceType}_${profile.chipsetModel}_${profile.modelYear}/${profile.firmwareVersion} (${profile.brand}, ${profile.model}) ${auxField}`;
59
+ }
60
+
61
+ if (document.querySelector('.content-container') && window.h5vcc && window.h5vcc.tizentube && window.h5vcc.tizentube.SetUserAgent) {
62
+ const ua = localStorage.getItem('userAgent');
63
+ if (ua) {
64
+ window.h5vcc.tizentube.SetUserAgent(ua);
65
+ location.reload();
66
+ }
67
+
68
+ const randomProfile = deviceProfiles[Math.floor(Math.random() * deviceProfiles.length)];
69
+ const spoofedUserAgent = generateUserAgent(randomProfile);
70
+ localStorage.setItem('userAgent', spoofedUserAgent);
71
+ window.h5vcc.tizentube.SetUserAgent(spoofedUserAgent);
72
+ location.reload();
73
+ }
@@ -0,0 +1,64 @@
1
+ window.queuedVideos = {
2
+ videos: [],
3
+ lastVideoId: null
4
+ };
5
+
6
+ import resolveCommand from '../resolveCommand.js';
7
+
8
+ function addListener() {
9
+ const videoPlayer = document.querySelector('.html5-video-player');
10
+ if (!videoPlayer) return setTimeout(addListener, 250);
11
+
12
+ videoPlayer.addEventListener('onStateChange', () => {
13
+ const playerStateObject = videoPlayer.getPlayerStateObject();
14
+ const videoData = videoPlayer.getVideoData();
15
+ if (window.queuedVideos.videos.length === 0) return;
16
+ if (playerStateObject.isEnded) {
17
+ const index = window.queuedVideos.videos.findIndex(v =>
18
+ (v.tileRenderer && v.tileRenderer.contentId === videoData.video_id) ||
19
+ (v.lockupViewModel && v.lockupViewModel.contentId === videoData.video_id)
20
+ );
21
+ if (index !== -1) {
22
+ if (index + 1 >= window.queuedVideos.videos.length) {
23
+ resolveCommand({
24
+ customAction: {
25
+ action: 'CLEAR_QUEUE'
26
+ }
27
+ });
28
+ return;
29
+ }
30
+ const element = window.queuedVideos.videos[index + 1];
31
+ const videoWatchEndpoint = element.tileRenderer ? element.tileRenderer.onSelectCommand : element.lockupViewModel.rendererContext.commandContext.onTap.innertubeCommand;
32
+ setTimeout(() => resolveCommand(videoWatchEndpoint), 500);
33
+ } else if (window.queuedVideos.lastVideoId) {
34
+ const lastIndex = window.queuedVideos.videos.findIndex(v =>
35
+ v.tileRenderer?.contentId === window.queuedVideos.lastVideoId ||
36
+ v.lockupViewModel?.contentId === window.queuedVideos.lastVideoId
37
+ );
38
+ if (lastIndex !== -1 && lastIndex + 1 < window.queuedVideos.videos.length) {
39
+ const element = window.queuedVideos.videos[lastIndex + 1];
40
+ const videoWatchEndpoint = element.tileRenderer ? element.tileRenderer.onSelectCommand : element.lockupViewModel.rendererContext.commandContext.onTap.innertubeCommand;
41
+ setTimeout(() => resolveCommand(videoWatchEndpoint), 500);
42
+ } else {
43
+ resolveCommand({
44
+ customAction: {
45
+ action: 'CLEAR_QUEUE'
46
+ }
47
+ });
48
+ return;
49
+ }
50
+ } else {
51
+ const element = window.queuedVideos.videos[0];
52
+ const videoWatchEndpoint = element.tileRenderer ? element.tileRenderer.onSelectCommand : element.lockupViewModel.rendererContext.commandContext.onTap.innertubeCommand;
53
+ setTimeout(() => resolveCommand(videoWatchEndpoint), 500);
54
+ }
55
+ } else if (playerStateObject.isPlaying) {
56
+ document.getElementById('container').style.setProperty('opacity', '1', 'important');
57
+ if (window.queuedVideos.videos.find(v => v.contentId === videoData.video_id)) {
58
+ window.queuedVideos.lastVideoId = videoData.video_id;
59
+ }
60
+ }
61
+ });
62
+ }
63
+
64
+ addListener();