mirror of
https://github.com/movie-web/movie-web.git
synced 2024-12-28 23:06:06 +00:00
Review comments
This commit is contained in:
parent
e400107d21
commit
fde90d4e8f
|
@ -1,5 +1,5 @@
|
|||
const a11yOff = Object.keys(require('eslint-plugin-jsx-a11y').rules)
|
||||
.reduce((acc, rule) => { acc[`jsx-a11y/${rule}`] = 'off'; return acc }, {})
|
||||
.reduce((acc, rule) => { acc[`jsx-a11y/${rule}`] = 'off'; return acc }, {})
|
||||
|
||||
module.exports = {
|
||||
extends: [
|
||||
|
@ -37,6 +37,10 @@ module.exports = {
|
|||
"@typescript-eslint/no-shadow": ["error"],
|
||||
"no-restricted-syntax": "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": [
|
||||
"error",
|
||||
{ extensions: [".js", ".tsx", ".jsx"] },
|
||||
|
|
|
@ -53,7 +53,6 @@ export const xemovieScraper: MWMediaProvider = {
|
|||
const aElement = parent.querySelector("a");
|
||||
if (!aElement) return;
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return {
|
||||
title: parent.querySelector("div > div > a > h6")?.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"));
|
||||
|
||||
for (const script of scripts) {
|
||||
// eslint-disable-next-line no-continue
|
||||
if (!script.textContent) continue;
|
||||
|
||||
if (script.textContent.match(/https:\/\/[a-z][0-9]\.xemovie\.com/)) {
|
||||
// eslint-disable-next-line
|
||||
let data = JSON.parse(JSON.stringify(eval(`(${script.textContent.replace("const data = ", "").split("};")[0]}})`)));
|
||||
const data = JSON.parse(JSON.stringify(eval(`(${script.textContent.replace("const data = ", "").split("};")[0]}})`)));
|
||||
streamUrl = data.playlist[0].file;
|
||||
|
||||
for (const [index, subtitleTrack] of data.playlist[0].tracks.entries()) {
|
||||
const subtitleBlob = URL.createObjectURL(
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await fetch(`${CORS_PROXY_URL}${subtitleTrack.file}`).then((captionRes) => captionRes.blob())
|
||||
); // do this so no need for CORS errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue