From f9c043ba327872e9697bd0839a0ae4ddd93a2d00 Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Mon, 12 Jan 2026 16:12:51 +0530 Subject: [PATCH] fix showbox token not reading --- README.md | 58 ++++++++++++-------------- src/constants/locales.ts | 3 +- src/screens/PluginsScreen.tsx | 13 ++++-- src/screens/SettingsScreen.tsx | 76 +++++++++++++++++++++++++++++++++- src/services/pluginService.ts | 36 +++++++++++----- 5 files changed, 139 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 28138694..ecf89b79 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# 🎬 Nuvio Media Hub +
@@ -8,10 +10,7 @@ [![Issues][issues-shield]][issues-url] [![License][license-shield]][license-url] -
-
Nuvio Logo -

🎬 Nuvio Media Hub

A modern media hub built with React Native and Expo
@@ -31,6 +30,7 @@

Table of Contents +
  1. About The Project @@ -40,26 +40,24 @@
  2. Getting Started
  3. Contributing
  4. Support
  5. -
  6. Support
  7. License
  8. Legal
  9. Contact
  10. Acknowledgments
  11. Built With
-
+ ## About The Project Nuvio Media Hub is a cross‑platform app for managing, discovering, and streaming your media via a flexible addon ecosystem. Built with React Native + Expo, it integrates providers and sync services while keeping a simple, fast UI. - - ## Installation ### Android + [![Download APK](https://img.shields.io/badge/Download-APK-green?style=for-the-badge)](https://github.com/tapframe/NuvioStreaming/releases/latest) Download the latest APK from [GitHub Releases](https://github.com/tapframe/NuvioStreaming/releases/latest) @@ -67,20 +65,21 @@ Download the latest APK from [GitHub Releases](https://github.com/tapframe/Nuvio ### iOS #### TestFlight (Recommended) - [![Join TestFlight](https://img.shields.io/badge/Join-TestFlight-blue?style=for-the-badge)](https://testflight.apple.com/join/QkKMGRqp) + +TestFlight Icon [![Join TestFlight](https://img.shields.io/badge/Join-TestFlight-blue?style=for-the-badge)](https://testflight.apple.com/join/QkKMGRqp) #### AltStore - [![Add to AltStore](https://img.shields.io/badge/Add%20to-AltStore-blue?style=for-the-badge)](https://tinyurl.com/NuvioAltstore) + +AltStore Logo [![Add to AltStore](https://img.shields.io/badge/Add%20to-AltStore-blue?style=for-the-badge)](https://tinyurl.com/NuvioAltstore) #### SideStore - [![Add to SideStore](https://img.shields.io/badge/Add%20to-SideStore-green?style=for-the-badge)](https://tinyurl.com/NuvioSidestore) + +SideStore Logo [![Add to SideStore](https://img.shields.io/badge/Add%20to-SideStore-green?style=for-the-badge)](https://tinyurl.com/NuvioSidestore) **Manual URL:** `https://raw.githubusercontent.com/tapframe/NuvioStreaming/main/nuvio-source.json`

(back to top)

- - ## Getting Started @@ -89,29 +88,23 @@ Follow the steps below to run the app locally for development. For detailed setu ### Development Build
- Build from Source + Build from Source -```bash -git clone https://github.com/tapframe/NuvioStreaming.git -cd NuvioStreaming -npm install -# If you hit peer dependency conflicts: -# npm install --legacy-peer-deps -npx expo start -``` + git clone https://github.com/tapframe/NuvioStreaming.git + cd NuvioStreaming + npm install + # If you hit peer dependency conflicts: + # npm install --legacy-peer-deps + npx expo start -```bash -npx expo prebuild -npx expo run:android # Android -npx expo run:ios # iOS -``` + npx expo prebuild + npx expo run:android # Android + npx expo run:ios # iOS

(back to top)

- - ## Contributing Contributions make the open‑source community amazing! Any contributions are greatly appreciated. @@ -151,6 +144,7 @@ For comprehensive legal information, including our full disclaimer, third-party ## Contact **Project Links:** + * GitHub: `https://github.com/tapframe` * Issues: `https://github.com/tapframe/NuvioStreaming/issues` @@ -171,13 +165,13 @@ For comprehensive legal information, including our full disclaimer, third-party

- + Skills Icons
React Native • Expo • TypeScript -

+

- ## Star History +## Star History @@ -199,4 +193,4 @@ For comprehensive legal information, including our full disclaimer, third-party [issues-shield]: https://img.shields.io/github/issues/tapframe/NuvioStreaming.svg?style=for-the-badge [issues-url]: https://github.com/tapframe/NuvioStreaming/issues [license-shield]: https://img.shields.io/github/license/tapframe/NuvioStreaming.svg?style=for-the-badge -[license-url]: http://www.gnu.org/licenses/gpl-3.0.en.html \ No newline at end of file +[license-url]: http://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/src/constants/locales.ts b/src/constants/locales.ts index ca0e5b5b..956192f9 100644 --- a/src/constants/locales.ts +++ b/src/constants/locales.ts @@ -5,5 +5,6 @@ export const LOCALES = [ { code: 'de', key: 'german' }, { code: 'ar', key: 'arabic' }, { code: 'fr', key: 'french' }, - { code: 'it', key: 'italian' } + { code: 'it', key: 'italian' }, + { code: 'es', key: 'spanish' } ]; \ No newline at end of file diff --git a/src/screens/PluginsScreen.tsx b/src/screens/PluginsScreen.tsx index 954d479b..c87326bd 100644 --- a/src/screens/PluginsScreen.tsx +++ b/src/screens/PluginsScreen.tsx @@ -1231,8 +1231,10 @@ const PluginsScreen: React.FC = () => { if (sb) { setShowboxScraperId(sb.id); const s = await pluginService.getScraperSettings(sb.id); - setShowboxUiToken(s.uiToken || ''); - setShowboxSavedToken(s.uiToken || ''); + // Check for multiple possible key names for the token + const token = s.uiToken || s.cookie || s.token || ''; + setShowboxUiToken(token); + setShowboxSavedToken(token); setShowboxTokenVisible(false); } else { setShowboxScraperId(null); @@ -1926,7 +1928,12 @@ const PluginsScreen: React.FC = () => { style={[styles.button, styles.primaryButton]} onPress={async () => { if (showboxScraperId) { - await pluginService.setScraperSettings(showboxScraperId, { uiToken: showboxUiToken }); + // Save with multiple keys to ensure the scraper finds it regardless of what key it checks + await pluginService.setScraperSettings(showboxScraperId, { + uiToken: showboxUiToken, + cookie: showboxUiToken, + token: showboxUiToken + }); } setShowboxSavedToken(showboxUiToken); openAlert('Saved', 'ShowBox settings updated'); diff --git a/src/screens/SettingsScreen.tsx b/src/screens/SettingsScreen.tsx index 69db5212..eaa56f0f 100644 --- a/src/screens/SettingsScreen.tsx +++ b/src/screens/SettingsScreen.tsx @@ -389,7 +389,22 @@ const SettingsScreen: React.FC = () => { return ; case 'appearance': - return ; + return ( + <> + + l.code === i18n.language)?.key}`)} + icon="globe" + renderControl={() => } + onPress={() => languageSheetRef.current?.present()} + isLast={true} + isTablet={isTablet} + /> + + + + ); case 'integrations': return ; @@ -571,6 +586,65 @@ const SettingsScreen: React.FC = () => { actions={alertActions} onClose={() => setAlertVisible(false)} /> + + + + + {t('settings.select_language')} + + languageSheetRef.current?.dismiss()}> + + + + + { + LOCALES.sort((a,b) => a.key.localeCompare(b.key)).map(l => + { + i18n.changeLanguage(l.code); + languageSheetRef.current?.dismiss(); + }} + > + + {t(`settings.${l.key}`)} + + {i18n.language === l.code && ( + + )} + + ) + } + + ); } diff --git a/src/services/pluginService.ts b/src/services/pluginService.ts index 2b14f96a..538210b4 100644 --- a/src/services/pluginService.ts +++ b/src/services/pluginService.ts @@ -1162,21 +1162,33 @@ class LocalScraperService { } - // Execute scraper code with full access to app environment (non-sandboxed) private async executePlugin(code: string, params: any, consoleOverride?: any): Promise { try { - // Get URL validation setting from storage const settingsData = await mmkvStorage.getItem('app_settings'); const settings = settingsData ? JSON.parse(settingsData) : {}; const urlValidationEnabled = settings.enableScraperUrlValidation ?? true; - // Load per-scraper settings for this run const allScraperSettingsRaw = await mmkvStorage.getItem(this.SCRAPER_SETTINGS_KEY); const allScraperSettings = allScraperSettingsRaw ? JSON.parse(allScraperSettingsRaw) : {}; - const perScraperSettings = (params && params.scraperId && allScraperSettings[params.scraperId]) + let perScraperSettings = (params && params.scraperId && allScraperSettings[params.scraperId]) ? allScraperSettings[params.scraperId] : (params?.settings || {}); + if (params?.scraperId?.toLowerCase().includes('showbox')) { + const token = perScraperSettings.uiToken || perScraperSettings.cookie || perScraperSettings.token; + if (token) { + perScraperSettings = { + ...perScraperSettings, + uiToken: token, + cookie: token, + token: token + }; + if (params) { + params.settings = perScraperSettings; + } + } + } + // Module exports for CommonJS compatibility const moduleExports: any = {}; const moduleObj = { exports: moduleExports }; @@ -1292,12 +1304,16 @@ class LocalScraperService { 'SCRAPER_ID', ` // Make env vars available globally for backward compatibility - if (typeof global !== 'undefined') { - global.PRIMARY_KEY = PRIMARY_KEY; - global.TMDB_API_KEY = TMDB_API_KEY; - global.SCRAPER_SETTINGS = SCRAPER_SETTINGS; - global.SCRAPER_ID = SCRAPER_ID; - global.URL_VALIDATION_ENABLED = URL_VALIDATION_ENABLED; + const globalScope = typeof global !== 'undefined' ? global : (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : this)); + + if (globalScope) { + globalScope.PRIMARY_KEY = PRIMARY_KEY; + globalScope.TMDB_API_KEY = TMDB_API_KEY; + globalScope.SCRAPER_SETTINGS = SCRAPER_SETTINGS; + globalScope.SCRAPER_ID = SCRAPER_ID; + globalScope.URL_VALIDATION_ENABLED = URL_VALIDATION_ENABLED; + } else { + logger.error('[Plugin Sandbox] Could not find global scope to inject settings'); } // Plugin code