1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-29 16:07:40 +01:00

Review comments

This commit is contained in:
James Hawkins 2022-05-02 19:12:04 +01:00
parent e400107d21
commit fde90d4e8f
2 changed files with 6 additions and 6 deletions

View file

@ -37,6 +37,10 @@ module.exports = {
"@typescript-eslint/no-shadow": ["error"], "@typescript-eslint/no-shadow": ["error"],
"no-restricted-syntax": "off", "no-restricted-syntax": "off",
"react/jsx-props-no-spreading": "off", "react/jsx-props-no-spreading": "off",
"consistent-return": "off",
"no-continue": "off",
"no-eval": "off",
"no-await-in-loop": "off",
"react/jsx-filename-extension": [ "react/jsx-filename-extension": [
"error", "error",
{ extensions: [".js", ".tsx", ".jsx"] }, { extensions: [".js", ".tsx", ".jsx"] },

View file

@ -53,7 +53,6 @@ export const xemovieScraper: MWMediaProvider = {
const aElement = parent.querySelector("a"); const aElement = parent.querySelector("a");
if (!aElement) return; if (!aElement) return;
// eslint-disable-next-line consistent-return
return { return {
title: parent.querySelector("div > div > a > h6")?.textContent, title: parent.querySelector("div > div > a > h6")?.textContent,
year: parent.querySelector("div.float-right")?.textContent, year: parent.querySelector("div.float-right")?.textContent,
@ -76,17 +75,14 @@ export const xemovieScraper: MWMediaProvider = {
const scripts = Array.from(new DOMParser().parseFromString(res, "text/html").querySelectorAll("script")); const scripts = Array.from(new DOMParser().parseFromString(res, "text/html").querySelectorAll("script"));
for (const script of scripts) { for (const script of scripts) {
// eslint-disable-next-line no-continue
if (!script.textContent) continue; if (!script.textContent) continue;
if (script.textContent.match(/https:\/\/[a-z][0-9]\.xemovie\.com/)) { if (script.textContent.match(/https:\/\/[a-z][0-9]\.xemovie\.com/)) {
// eslint-disable-next-line const data = JSON.parse(JSON.stringify(eval(`(${script.textContent.replace("const data = ", "").split("};")[0]}})`)));
let data = JSON.parse(JSON.stringify(eval(`(${script.textContent.replace("const data = ", "").split("};")[0]}})`)));
streamUrl = data.playlist[0].file; streamUrl = data.playlist[0].file;
for (const [index, subtitleTrack] of data.playlist[0].tracks.entries()) { for (const [index, subtitleTrack] of data.playlist[0].tracks.entries()) {
const subtitleBlob = URL.createObjectURL( const subtitleBlob = URL.createObjectURL(
// eslint-disable-next-line no-await-in-loop
await fetch(`${CORS_PROXY_URL}${subtitleTrack.file}`).then((captionRes) => captionRes.blob()) await fetch(`${CORS_PROXY_URL}${subtitleTrack.file}`).then((captionRes) => captionRes.blob())
); // do this so no need for CORS errors ); // do this so no need for CORS errors