mirror of
https://github.com/sussy-code/smov.git
synced 2024-12-20 14:37:43 +01:00
Merge pull request #98 from JamesHawkinss/dev
Fix lower qualities for SuperStream
This commit is contained in:
commit
aa2de4b365
1 changed files with 12 additions and 6 deletions
|
@ -174,10 +174,12 @@ export const superStreamScraper: MWMediaProvider = {
|
||||||
};
|
};
|
||||||
const mediaRes = (await get(apiQuery).then((r) => r.json())).data;
|
const mediaRes = (await get(apiQuery).then((r) => r.json())).data;
|
||||||
const hdQuality =
|
const hdQuality =
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "1080p") ??
|
mediaRes.list.find((quality: any) => (quality.quality === "1080p" && quality.path)) ??
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "720p") ??
|
mediaRes.list.find((quality: any) => (quality.quality === "720p" && quality.path)) ??
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "480p") ??
|
mediaRes.list.find((quality: any) => (quality.quality === "480p" && quality.path)) ??
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "360p");
|
mediaRes.list.find((quality: any) => (quality.quality === "360p" && quality.path));
|
||||||
|
|
||||||
|
if (!hdQuality) throw new Error("No quality could be found.");
|
||||||
|
|
||||||
const subtitleApiQuery = {
|
const subtitleApiQuery = {
|
||||||
fid: hdQuality.fid,
|
fid: hdQuality.fid,
|
||||||
|
@ -215,8 +217,12 @@ export const superStreamScraper: MWMediaProvider = {
|
||||||
};
|
};
|
||||||
const mediaRes = (await get(apiQuery).then((r) => r.json())).data;
|
const mediaRes = (await get(apiQuery).then((r) => r.json())).data;
|
||||||
const hdQuality =
|
const hdQuality =
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "1080p") ??
|
mediaRes.list.find((quality: any) => (quality.quality === "1080p" && quality.path)) ??
|
||||||
mediaRes.list.find((quality: any) => quality.quality === "720p");
|
mediaRes.list.find((quality: any) => (quality.quality === "720p" && quality.path)) ??
|
||||||
|
mediaRes.list.find((quality: any) => (quality.quality === "480p" && quality.path)) ??
|
||||||
|
mediaRes.list.find((quality: any) => (quality.quality === "360p" && quality.path));
|
||||||
|
|
||||||
|
if (!hdQuality) throw new Error("No quality could be found.");
|
||||||
|
|
||||||
const subtitleApiQuery = {
|
const subtitleApiQuery = {
|
||||||
fid: hdQuality.fid,
|
fid: hdQuality.fid,
|
||||||
|
|
Loading…
Reference in a new issue