mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 16:33:26 +00:00
Fix 4k for febbox
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@movie-web/providers",
|
"name": "@movie-web/providers",
|
||||||
"version": "2.0.0",
|
"version": "2.0.1",
|
||||||
"description": "Package that contains all the providers of movie-web",
|
"description": "Package that contains all the providers of movie-web",
|
||||||
"main": "./lib/index.umd.js",
|
"main": "./lib/index.umd.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
|
@@ -11,7 +11,6 @@ interface FebboxQuality {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mapToQuality(quality: FebboxQuality): FebboxQuality | null {
|
function mapToQuality(quality: FebboxQuality): FebboxQuality | null {
|
||||||
console.log(quality);
|
|
||||||
const q = quality.real_quality.replace('p', '').toLowerCase();
|
const q = quality.real_quality.replace('p', '').toLowerCase();
|
||||||
if (!allowedQualities.includes(q)) return null;
|
if (!allowedQualities.includes(q)) return null;
|
||||||
return {
|
return {
|
||||||
@@ -29,8 +28,8 @@ export async function getStreamQualities(ctx: ScrapeContext, apiQuery: object) {
|
|||||||
const qualities: Record<string, StreamFile> = {};
|
const qualities: Record<string, StreamFile> = {};
|
||||||
|
|
||||||
allowedQualities.forEach((quality) => {
|
allowedQualities.forEach((quality) => {
|
||||||
const foundQuality = qualityMap.find((q) => q.real_quality === quality);
|
const foundQuality = qualityMap.find((q) => q.real_quality === quality && q.path);
|
||||||
if (foundQuality && foundQuality.path) {
|
if (foundQuality) {
|
||||||
qualities[quality] = {
|
qualities[quality] = {
|
||||||
type: 'mp4',
|
type: 'mp4',
|
||||||
url: foundQuality.path,
|
url: foundQuality.path,
|
||||||
|
@@ -116,9 +116,13 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output.embeds.length > 0) {
|
// run embed scrapers on listed embeds
|
||||||
|
const sortedEmbeds = output.embeds;
|
||||||
|
sortedEmbeds.sort((a, b) => embedIds.indexOf(a.embedId) - embedIds.indexOf(b.embedId));
|
||||||
|
|
||||||
|
if (sortedEmbeds.length > 0) {
|
||||||
ops.events?.discoverEmbeds?.({
|
ops.events?.discoverEmbeds?.({
|
||||||
embeds: output.embeds.map((v, i) => ({
|
embeds: sortedEmbeds.map((v, i) => ({
|
||||||
id: [s.id, i].join('-'),
|
id: [s.id, i].join('-'),
|
||||||
embedScraperId: v.embedId,
|
embedScraperId: v.embedId,
|
||||||
})),
|
})),
|
||||||
@@ -126,10 +130,6 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// run embed scrapers on listed embeds
|
|
||||||
const sortedEmbeds = output.embeds;
|
|
||||||
sortedEmbeds.sort((a, b) => embedIds.indexOf(a.embedId) - embedIds.indexOf(b.embedId));
|
|
||||||
|
|
||||||
for (const ind in sortedEmbeds) {
|
for (const ind in sortedEmbeds) {
|
||||||
if (!Object.prototype.hasOwnProperty.call(sortedEmbeds, ind)) continue;
|
if (!Object.prototype.hasOwnProperty.call(sortedEmbeds, ind)) continue;
|
||||||
const e = sortedEmbeds[ind];
|
const e = sortedEmbeds[ind];
|
||||||
|
Reference in New Issue
Block a user