mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-27 07:11:47 +01:00
Make superstream a fast boi
This commit is contained in:
parent
1524a3af39
commit
31fcd22822
@ -18,6 +18,12 @@ import { compareTitle } from "@/utils/titleMatch";
|
|||||||
|
|
||||||
const nanoid = customAlphabet("0123456789abcdef", 32);
|
const nanoid = customAlphabet("0123456789abcdef", 32);
|
||||||
|
|
||||||
|
function makeFasterUrl(url: string) {
|
||||||
|
const fasterUrl = new URL(url);
|
||||||
|
fasterUrl.host = "mp4.shegu.net"; // this domain is faster
|
||||||
|
return fasterUrl.toString();
|
||||||
|
}
|
||||||
|
|
||||||
const qualityMap = {
|
const qualityMap = {
|
||||||
"360p": MWStreamQuality.Q360P,
|
"360p": MWStreamQuality.Q360P,
|
||||||
"480p": MWStreamQuality.Q480P,
|
"480p": MWStreamQuality.Q480P,
|
||||||
@ -199,7 +205,7 @@ registerProvider({
|
|||||||
return {
|
return {
|
||||||
embeds: [],
|
embeds: [],
|
||||||
stream: {
|
stream: {
|
||||||
streamUrl: hdQuality.path,
|
streamUrl: makeFasterUrl(hdQuality.path),
|
||||||
quality: qualityMap[hdQuality.quality as QualityInMap],
|
quality: qualityMap[hdQuality.quality as QualityInMap],
|
||||||
type: MWStreamType.MP4,
|
type: MWStreamType.MP4,
|
||||||
captions: mappedCaptions,
|
captions: mappedCaptions,
|
||||||
@ -249,16 +255,13 @@ registerProvider({
|
|||||||
.map(convertSubtitles)
|
.map(convertSubtitles)
|
||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
const fasterUrl = new URL(hdQuality.path);
|
|
||||||
fasterUrl.host = "mp4.shegu.net"; // this domain is faster
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
embeds: [],
|
embeds: [],
|
||||||
stream: {
|
stream: {
|
||||||
quality: qualityMap[
|
quality: qualityMap[
|
||||||
hdQuality.quality as QualityInMap
|
hdQuality.quality as QualityInMap
|
||||||
] as MWStreamQuality,
|
] as MWStreamQuality,
|
||||||
streamUrl: fasterUrl.toString(),
|
streamUrl: makeFasterUrl(hdQuality.path),
|
||||||
type: MWStreamType.MP4,
|
type: MWStreamType.MP4,
|
||||||
captions: mappedCaptions,
|
captions: mappedCaptions,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user