[Skip to content](https://github.com/tapframe/NuvioStreamsAddon/blob/master/providers/Showbox.js#start-of-content)

You signed in with another tab or window. [Reload](https://github.com/tapframe/NuvioStreamsAddon/blob/master/providers/Showbox.js) to refresh your session.You signed out in another tab or window. [Reload](https://github.com/tapframe/NuvioStreamsAddon/blob/master/providers/Showbox.js) to refresh your session.You switched accounts on another tab or window. [Reload](https://github.com/tapframe/NuvioStreamsAddon/blob/master/providers/Showbox.js) to refresh your session.Dismiss alert

{{ message }}

This repository was archived by the owner on Apr 21, 2026. It is now read-only.


[tapframe](https://github.com/tapframe)/ **[NuvioStreamsAddon](https://github.com/tapframe/NuvioStreamsAddon)** Public archive

- [Notifications](https://github.com/login?return_to=%2Ftapframe%2FNuvioStreamsAddon) You must be signed in to change notification settings
- [Fork\\
197](https://github.com/login?return_to=%2Ftapframe%2FNuvioStreamsAddon)
- [Star\\
326](https://github.com/login?return_to=%2Ftapframe%2FNuvioStreamsAddon)


## Collapse file tree

## Files

master

Search this repository(forward slash)` forward slash/`

/

# Showbox.js

Copy path

Blame

More file actions

Blame

More file actions

## Latest commit

[![tapframe](https://avatars.githubusercontent.com/u/85391825?v=4&size=40)](https://github.com/tapframe)[tapframe](https://github.com/tapframe/NuvioStreamsAddon/commits?author=tapframe)

[updated showbox logic](https://github.com/tapframe/NuvioStreamsAddon/commit/73cc5574631e6111014d021a3c84f42c6a6d961e)

7 months agoDec 30, 2025

[73cc557](https://github.com/tapframe/NuvioStreamsAddon/commit/73cc5574631e6111014d021a3c84f42c6a6d961e) · 7 months agoDec 30, 2025

## History

[History](https://github.com/tapframe/NuvioStreamsAddon/commits/master/providers/Showbox.js)

Open commit details

[View commit history for this file.](https://github.com/tapframe/NuvioStreamsAddon/commits/master/providers/Showbox.js) History

446 lines (385 loc) · 20.2 KB

/

# Showbox.js

Copy path

Top

## File metadata and controls

- Code

- Blame


446 lines (385 loc) · 20.2 KB

[Raw](https://github.com/tapframe/NuvioStreamsAddon/raw/refs/heads/master/providers/Showbox.js)

Copy raw file

Download raw file

You must be signed in to make or propose changes

More edit options

Open symbols panel

Edit and raw actions

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

426

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

require('dotenv').config();

constaxios=require('axios');

// TMDB API Configuration (for convertImdbToTmdb helper)

constTMDB\_API\_KEY=process.env.TMDB\_API\_KEY\|\|'439c478a771f35c05022f9feabcca01c';

constTMDB\_BASE\_URL='https://api.themoviedb.org/3';

// API Base URL

constFEBAPI\_BASE\_URL='https://febapi.nuvioapp.space/api/media';

/\*\*

\\* Parse quality from label string

\*/

constparseQualityFromLabel=(label)=>{

if(!label)return"ORG";

constlabelLower=String(label).toLowerCase();

if(labelLower.includes('1080p')\|\|labelLower.includes('1080')){

return"1080p";

}elseif(labelLower.includes('720p')\|\|labelLower.includes('720')){

return"720p";

}elseif(labelLower.includes('480p')\|\|labelLower.includes('480')){

return"480p";

}elseif(labelLower.includes('360p')\|\|labelLower.includes('360')){

return"360p";

}elseif(labelLower.includes('2160p')\|\|labelLower.includes('2160')\|\|

labelLower.includes('4k')\|\|labelLower.includes('uhd')){

return"2160p";

}elseif(labelLower.includes('hd')){

return"720p";// Assuming HD is 720p

}elseif(labelLower.includes('sd')){

return"480p";// Assuming SD is 480p

}

// Use ORG (original) label for unknown quality

return"ORG";

};

/\*\*

\\* Extract codec details from filename/text

\*/

constextractCodecDetails=(text)=>{

if(!text\|\|typeoftext!=='string')return\[\];

constdetails=newSet();

constlowerText=text.toLowerCase();

// Video Codecs & Technologies

if(lowerText.includes('dolby vision')\|\|lowerText.includes('dovi')\|\|lowerText.includes('.dv.'))details.add('DV');

if(lowerText.includes('hdr10+')\|\|lowerText.includes('hdr10plus'))details.add('HDR10+');

elseif(lowerText.includes('hdr'))details.add('HDR');// General HDR if not HDR10+

if(lowerText.includes('sdr'))details.add('SDR');

if(lowerText.includes('av1'))details.add('AV1');

elseif(lowerText.includes('h265')\|\|lowerText.includes('x265')\|\|lowerText.includes('hevc'))details.add('H.265');

elseif(lowerText.includes('h264')\|\|lowerText.includes('x264')\|\|lowerText.includes('avc'))details.add('H.264');

// Audio Codecs

if(lowerText.includes('atmos'))details.add('Atmos');

if(lowerText.includes('truehd')\|\|lowerText.includes('true-hd'))details.add('TrueHD');

if(lowerText.includes('dts-hd ma')\|\|lowerText.includes('dtshdma')\|\|lowerText.includes('dts-hdhr'))details.add('DTS-HD MA');

elseif(lowerText.includes('dts-hd'))details.add('DTS-HD');// General DTS-HD if not MA/HR

elseif(lowerText.includes('dts')&&!lowerText.includes('dts-hd'))details.add('DTS');// Plain DTS

if(lowerText.includes('eac3')\|\|lowerText.includes('e-ac-3')\|\|lowerText.includes('dd+')\|\|lowerText.includes('ddplus'))details.add('EAC3');

elseif(lowerText.includes('ac3')\|\|(lowerText.includes('dd')&&!lowerText.includes('dd+')&&!lowerText.includes('ddp')))details.add('AC3');// Plain AC3/DD

if(lowerText.includes('aac'))details.add('AAC');

if(lowerText.includes('opus'))details.add('Opus');

if(lowerText.includes('mp3'))details.add('MP3');

// Bit depth (less common but useful)

if(lowerText.includes('10bit')\|\|lowerText.includes('10-bit'))details.add('10-bit');

elseif(lowerText.includes('8bit')\|\|lowerText.includes('8-bit'))details.add('8-bit');

returnArray.from(details);

};

/\*\*

\\* Helper function to parse size string to bytes

\*/

constparseSizeToBytes=(sizeString)=>{

if(!sizeString\|\|typeofsizeString!=='string')returnNumber.MAX\_SAFE\_INTEGER;

constsizeLower=sizeString.toLowerCase();

if(sizeLower.includes('unknown')\|\|sizeLower.includes('n/a')){

returnNumber.MAX\_SAFE\_INTEGER;// Sort unknown/NA sizes last

}

constunits={

gb: 1024\*1024\*1024,

mb: 1024\*1024,

kb: 1024,

b: 1

};

constmatch=sizeString.match(/(\[\\d.\]+)\\s\*(gb\|mb\|kb\|b)/i);

if(match&&match\[1\]&&match\[2\]){

constvalue=parseFloat(match\[1\]);

constunit=match\[2\].toLowerCase();

if(!isNaN(value)&&units\[unit\]){

returnMath.floor(value\*units\[unit\]);

}

}

returnNumber.MAX\_SAFE\_INTEGER;// Fallback for unparsed strings

};

/\*\*

\\* Utility function to sort streams by quality in order of resolution

\*/

constsortStreamsByQuality=(streams)=>{

// Since Stremio displays streams from bottom to top,

// we need to sort in reverse order to what we want to show

constqualityOrder={

"ORG": 1,// ORG will show at the top (since it's at the bottom of the list)

"2160p": 2,

"1080p": 3,

"720p": 4,

"480p": 5,

"360p": 6// 360p will show at the bottom

};

// Provider sort order: lower number means earlier in array (lower in Stremio UI for same quality/size)

constproviderSortKeys={

'ShowBox': 1,

'Xprime.tv': 2,

'HollyMovieHD': 3,

'Soaper TV': 4,

// Default for unknown providers

default: 99

};

return\[...streams\].sort((a,b)=>{

constqualityA=a.quality\|\|"ORG";

constqualityB=b.quality\|\|"ORG";

constorderA=qualityOrder\[qualityA\]\|\|10;

constorderB=qualityOrder\[qualityB\]\|\|10;

// First, compare by quality order

if(orderA!==orderB){

returnorderA-orderB;

}

// If qualities are the same, compare by size (descending - larger sizes first means earlier in array)

constsizeAInBytes=parseSizeToBytes(a.size);

constsizeBInBytes=parseSizeToBytes(b.size);

if(sizeAInBytes!==sizeBInBytes){

timeout: 30000,

headers: {

'User-Agent': 'NuvioStreamsAddon/1.0'

}

});

if(!response.data\|\|!response.data.success){

console.log(\`\[ShowBox\] API returned unsuccessful response\`);

console.timeEnd(mainTimerLabel);

return\[\];

}

constapiData=response.data;

conststreams=\[\];

// Process versions array

if(apiData.versions&&Array.isArray(apiData.versions)){

for(constversionofapiData.versions){

constversionName=version.name\|\|'Unknown';

constversionSize=version.size\|\|'Unknown size';

// Process links array for each version

if(version.links&&Array.isArray(version.links)){

for(constlinkofversion.links){

if(!link.url){

continue;// Skip links without URL

}

conststreamName=link.name\|\|'Auto';

conststreamTitle=versionName;

conststreamUrl=link.url;

conststreamQuality=parseQualityFromLabel(link.quality\|\|link.name);

conststreamSize=link.size\|\|versionSize;

conststreamCodecs=extractCodecDetails(versionName);

streams.push({

name: streamName,

title: streamTitle,

url: streamUrl,

quality: streamQuality,

codecs: streamCodecs,

size: streamSize,

provider: 'ShowBox'

});

}

}

}

}

console.log(\`\[ShowBox\] Successfully parsed ${streams.length} streams from API response\`);

// Sort streams by quality before returning

constsortedStreams=sortStreamsByQuality(streams);

console.timeEnd(mainTimerLabel);

returnsortedStreams;

}catch(error){

consterrorMessage=error.response ? \`${error.message} (Status: ${error.response.status})\` : error.message;

console.error(\`\[ShowBox\] Error fetching streams: ${errorMessage}\`);

if(error.response&&error.response.data){

console.error(\`\[ShowBox\] Response data:\`,JSON.stringify(error.response.data).substring(0,500));

}

console.timeEnd(mainTimerLabel);

return\[\];

}

};

// Export required functions

module.exports={

getStreamsFromTmdbId,

parseQualityFromLabel,

convertImdbToTmdb,

sortStreamsByQuality

};

You can’t perform that action at this time.