mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:33:25 +00:00
Merge pull request #134 from movie-web/dev
Version 2.2.7: Fixing showbox once again
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
title: 'Changelog'
|
title: 'Changelog'
|
||||||
---
|
---
|
||||||
|
|
||||||
|
# Version 2.2.7
|
||||||
|
- Fix showbox
|
||||||
|
|
||||||
# Version 2.2.6
|
# Version 2.2.6
|
||||||
- Fix febbox
|
- Fix febbox
|
||||||
- Validate if a stream is actually playable. Streams that are not responding are no longer returned.
|
- Validate if a stream is actually playable. Streams that are not responding are no longer returned.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@movie-web/providers",
|
"name": "@movie-web/providers",
|
||||||
"version": "2.2.6",
|
"version": "2.2.7",
|
||||||
"description": "Package that contains all the providers of movie-web",
|
"description": "Package that contains all the providers of movie-web",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./lib/index.umd.js",
|
"main": "./lib/index.umd.js",
|
||||||
|
@@ -22,26 +22,26 @@ export async function validatePlayableStream(
|
|||||||
stream: Stream,
|
stream: Stream,
|
||||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||||
): Promise<Stream | null> {
|
): Promise<Stream | null> {
|
||||||
const fetcher = stream.flags.length === 1 && stream.flags.includes('cors-allowed') ? ops.fetcher : ops.proxiedFetcher;
|
|
||||||
if (stream.type === 'hls') {
|
if (stream.type === 'hls') {
|
||||||
const headResult = await fetcher.full(stream.playlist, {
|
const result = await ops.proxiedFetcher.full(stream.playlist, {
|
||||||
method: 'HEAD',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
...stream.preferredHeaders,
|
...stream.preferredHeaders,
|
||||||
...stream.headers,
|
...stream.headers,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (headResult.statusCode !== 200) return null;
|
if (result.statusCode < 200 || result.statusCode >= 400) return null;
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
if (stream.type === 'file') {
|
if (stream.type === 'file') {
|
||||||
const validQualitiesResults = await Promise.all(
|
const validQualitiesResults = await Promise.all(
|
||||||
Object.values(stream.qualities).map((quality) =>
|
Object.values(stream.qualities).map((quality) =>
|
||||||
fetcher.full(quality.url, {
|
ops.proxiedFetcher.full(quality.url, {
|
||||||
method: 'HEAD',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
...stream.preferredHeaders,
|
...stream.preferredHeaders,
|
||||||
...stream.headers,
|
...stream.headers,
|
||||||
|
Range: 'bytes=0-1',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
@@ -49,7 +49,7 @@ export async function validatePlayableStream(
|
|||||||
// remove invalid qualities from the stream
|
// remove invalid qualities from the stream
|
||||||
const validQualities = stream.qualities;
|
const validQualities = stream.qualities;
|
||||||
Object.keys(stream.qualities).forEach((quality, index) => {
|
Object.keys(stream.qualities).forEach((quality, index) => {
|
||||||
if (validQualitiesResults[index].statusCode !== 200) {
|
if (validQualitiesResults[index].statusCode < 200 || validQualitiesResults[index].statusCode >= 400) {
|
||||||
delete validQualities[quality as keyof typeof stream.qualities];
|
delete validQualities[quality as keyof typeof stream.qualities];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user