Merge pull request #512 from movie-web/hotfix-superstream-subs

Hotfix: superstream subtitles
This commit is contained in:
William Oldham 2023-12-07 13:45:38 +00:00 committed by GitHub
commit 173f1f2f90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "movie-web", "name": "movie-web",
"version": "3.2.5", "version": "3.2.6",
"private": true, "private": true,
"homepage": "https://movie-web.app", "homepage": "https://movie-web.app",
"dependencies": { "dependencies": {

View file

@ -39,6 +39,10 @@ const apiUrls = [
]; ];
const appKey = atob("bW92aWVib3g="); const appKey = atob("bW92aWVib3g=");
const appId = atob("Y29tLnRkby5zaG93Ym94"); const appId = atob("Y29tLnRkby5zaG93Ym94");
const captionsDomains = [
atob("bWJwaW1hZ2VzLmNodWF4aW4uY29t"),
atob("aW1hZ2VzLnNoZWd1Lm5ldA=="),
];
// cryptography stuff // cryptography stuff
const crypto = { const crypto = {
@ -119,11 +123,18 @@ const convertSubtitles = (subtitleGroup: any): MWCaption | null => {
let subtitles = subtitleGroup.subtitles; let subtitles = subtitleGroup.subtitles;
subtitles = subtitles subtitles = subtitles
.map((subFile: any) => { .map((subFile: any) => {
const supported = isSupportedSubtitle(subFile.file_path); const filePath = subFile.file_path
.replace(captionsDomains[0], captionsDomains[1])
.replace(/\s/g, "+")
.replace(/[()]/g, (c: string) => {
return `%${c.charCodeAt(0).toString(16)}`;
});
const supported = isSupportedSubtitle(filePath);
if (!supported) return null; if (!supported) return null;
const type = getMWCaptionTypeFromUrl(subFile.file_path); const type = getMWCaptionTypeFromUrl(filePath);
return { return {
...subFile, ...subFile,
file_path: filePath,
type: type as MWCaptionType, type: type as MWCaptionType,
}; };
}) })