mirror of
https://github.com/sussy-code/providers.git
synced 2026-04-15 06:00:41 +00:00
remove removeBadUrlParams
This commit is contained in:
parent
f8a5120064
commit
92db2c1c3f
1 changed files with 1 additions and 16 deletions
|
|
@ -20,21 +20,6 @@ function mapToQuality(quality: FebboxQuality): FebboxQuality | null {
|
|||
};
|
||||
}
|
||||
|
||||
function removeBadUrlParams(url: string): string {
|
||||
const urlObject = new URL(url);
|
||||
|
||||
const urlSearchParams = new URLSearchParams(urlObject.search);
|
||||
|
||||
const keysToKeep = ['KEY1', 'KEY2'];
|
||||
for (const key of Array.from(urlSearchParams.keys())) {
|
||||
if (!keysToKeep.includes(key)) {
|
||||
urlSearchParams.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
return `${urlObject.origin}${urlObject.pathname}?${urlSearchParams.toString()}`;
|
||||
}
|
||||
|
||||
export async function getStreamQualities(ctx: ScrapeContext, apiQuery: object) {
|
||||
const mediaRes: { list: FebboxQuality[] } = (await sendRequest(ctx, apiQuery)).data;
|
||||
|
||||
|
|
@ -47,7 +32,7 @@ export async function getStreamQualities(ctx: ScrapeContext, apiQuery: object) {
|
|||
if (foundQuality) {
|
||||
qualities[quality] = {
|
||||
type: 'mp4',
|
||||
url: removeBadUrlParams(foundQuality.path),
|
||||
url: foundQuality.path,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue