mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-13 13:30:46 +00:00
Fixed Webstreamer addon support issue
This commit is contained in:
parent
f111514090
commit
6b4391e954
2 changed files with 31 additions and 5 deletions
|
|
@ -75,6 +75,29 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
backdrop
|
backdrop
|
||||||
} = route.params;
|
} = route.params;
|
||||||
|
|
||||||
|
// Check if the stream is from Xprime (by provider name or URL pattern)
|
||||||
|
const isXprimeStream = streamProvider === 'xprime' || streamProvider === 'Xprime' ||
|
||||||
|
(uri && /flutch.*\.workers\.dev|fsl\.fastcloud\.casa|xprime/i.test(uri));
|
||||||
|
|
||||||
|
// Xprime-specific headers for better compatibility (from local-scrapers-repo)
|
||||||
|
const getXprimeHeaders = () => {
|
||||||
|
if (!isXprimeStream) return {};
|
||||||
|
const xprimeHeaders = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
||||||
|
'Accept': 'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
|
||||||
|
'Accept-Language': 'en-US,en;q=0.9',
|
||||||
|
'Accept-Encoding': 'identity',
|
||||||
|
'Origin': 'https://xprime.tv',
|
||||||
|
'Referer': 'https://xprime.tv/',
|
||||||
|
'Sec-Fetch-Dest': 'video',
|
||||||
|
'Sec-Fetch-Mode': 'no-cors',
|
||||||
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
|
'DNT': '1'
|
||||||
|
} as any;
|
||||||
|
logger.log('[AndroidVideoPlayer] Applying Xprime headers for stream:', uri);
|
||||||
|
return xprimeHeaders;
|
||||||
|
};
|
||||||
|
|
||||||
// Optional hint not yet in typed navigator params
|
// Optional hint not yet in typed navigator params
|
||||||
const videoType = (route.params as any).videoType as string | undefined;
|
const videoType = (route.params as any).videoType as string | undefined;
|
||||||
|
|
||||||
|
|
@ -2414,7 +2437,7 @@ const AndroidVideoPlayer: React.FC = () => {
|
||||||
<Video
|
<Video
|
||||||
ref={videoRef}
|
ref={videoRef}
|
||||||
style={[styles.video, customVideoStyles, { transform: [{ scale: zoomScale }] }]}
|
style={[styles.video, customVideoStyles, { transform: [{ scale: zoomScale }] }]}
|
||||||
source={{ uri: currentStreamUrl, headers: headers || (Platform.OS === 'android' ? defaultAndroidHeaders() : defaultIosHeaders()), type: (currentVideoType as any) }}
|
source={{ uri: currentStreamUrl, headers: getXprimeHeaders() || headers || (Platform.OS === 'android' ? defaultAndroidHeaders() : defaultIosHeaders()), type: (currentVideoType as any) }}
|
||||||
paused={paused}
|
paused={paused}
|
||||||
onLoadStart={() => {
|
onLoadStart={() => {
|
||||||
loadStartAtRef.current = Date.now();
|
loadStartAtRef.current = Date.now();
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ const VideoPlayer: React.FC = () => {
|
||||||
// Xprime-specific headers for better compatibility (from local-scrapers-repo)
|
// Xprime-specific headers for better compatibility (from local-scrapers-repo)
|
||||||
const getXprimeHeaders = () => {
|
const getXprimeHeaders = () => {
|
||||||
if (!isXprimeStream) return {};
|
if (!isXprimeStream) return {};
|
||||||
return {
|
const xprimeHeaders = {
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
||||||
'Accept': 'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
|
'Accept': 'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5',
|
||||||
'Accept-Language': 'en-US,en;q=0.9',
|
'Accept-Language': 'en-US,en;q=0.9',
|
||||||
|
|
@ -66,6 +66,8 @@ const VideoPlayer: React.FC = () => {
|
||||||
'Sec-Fetch-Site': 'cross-site',
|
'Sec-Fetch-Site': 'cross-site',
|
||||||
'DNT': '1'
|
'DNT': '1'
|
||||||
} as any;
|
} as any;
|
||||||
|
logger.log('[VideoPlayer] Applying Xprime headers for stream:', uri);
|
||||||
|
return xprimeHeaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if the file format is MKV
|
// Check if the file format is MKV
|
||||||
|
|
@ -2240,10 +2242,11 @@ const VideoPlayer: React.FC = () => {
|
||||||
ref={vlcRef}
|
ref={vlcRef}
|
||||||
style={[styles.video, customVideoStyles, { transform: [{ scale: zoomScale }] }]}
|
style={[styles.video, customVideoStyles, { transform: [{ scale: zoomScale }] }]}
|
||||||
source={(() => {
|
source={(() => {
|
||||||
// FORCEFULLY use headers from route params if available - no filtering or modification
|
// Use Xprime headers if detected, otherwise use headers from route params
|
||||||
const sourceWithHeaders = headers ? {
|
const finalHeaders = getXprimeHeaders() || headers;
|
||||||
|
const sourceWithHeaders = finalHeaders ? {
|
||||||
uri: currentStreamUrl,
|
uri: currentStreamUrl,
|
||||||
headers: headers
|
headers: finalHeaders
|
||||||
} : { uri: currentStreamUrl };
|
} : { uri: currentStreamUrl };
|
||||||
|
|
||||||
return sourceWithHeaders;
|
return sourceWithHeaders;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue