Fix febbox
This commit is contained in:
parent
6f9c0517b8
commit
9d204c381f
|
@ -8,7 +8,7 @@ const febBoxBase = `https://www.febbox.com`;
|
||||||
const allowedQualities = ['360', '480', '720', '1080'];
|
const allowedQualities = ['360', '480', '720', '1080'];
|
||||||
|
|
||||||
export const febBoxScraper = makeEmbed({
|
export const febBoxScraper = makeEmbed({
|
||||||
id: 'febBox',
|
id: 'febbox',
|
||||||
name: 'FebBox',
|
name: 'FebBox',
|
||||||
rank: 160,
|
rank: 160,
|
||||||
async scrape(ctx) {
|
async scrape(ctx) {
|
||||||
|
@ -20,6 +20,9 @@ export const febBoxScraper = makeEmbed({
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
}>('/file/file_share_list', {
|
}>('/file/file_share_list', {
|
||||||
|
headers: {
|
||||||
|
'accept-language': 'en', // without this header, the request is marked as a webscraper
|
||||||
|
},
|
||||||
baseUrl: febBoxBase,
|
baseUrl: febBoxBase,
|
||||||
query: {
|
query: {
|
||||||
share_key: shareKey,
|
share_key: shareKey,
|
||||||
|
@ -38,6 +41,9 @@ export const febBoxScraper = makeEmbed({
|
||||||
baseUrl: febBoxBase,
|
baseUrl: febBoxBase,
|
||||||
body: formParams,
|
body: formParams,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'accept-language': 'en', // without this header, the request is marked as a webscraper
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const sourcesMatch = player?.match(/var sources = (\[[^\]]+\]);/);
|
const sourcesMatch = player?.match(/var sources = (\[[^\]]+\]);/);
|
||||||
|
@ -46,9 +52,10 @@ export const febBoxScraper = makeEmbed({
|
||||||
const embedQualities: Record<string, StreamFile> = {};
|
const embedQualities: Record<string, StreamFile> = {};
|
||||||
|
|
||||||
qualities.forEach((quality: { file: string; label: string }) => {
|
qualities.forEach((quality: { file: string; label: string }) => {
|
||||||
if (allowedQualities.includes(quality.label.replace('P', ''))) {
|
const normalizedLabel = quality.label.toLowerCase().replace('p', '');
|
||||||
|
if (allowedQualities.includes(normalizedLabel)) {
|
||||||
if (!quality.file) return;
|
if (!quality.file) return;
|
||||||
embedQualities[quality.label.replace('P', '')] = {
|
embedQualities[normalizedLabel] = {
|
||||||
type: 'mp4',
|
type: 'mp4',
|
||||||
url: quality.file,
|
url: quality.file,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue