fix: dont include config in regex

This commit is contained in:
Viren070
2024-12-31 21:26:11 +00:00
parent 23a573f467
commit af577da620
2 changed files with 3 additions and 5 deletions
+2 -2
View File
@@ -63,8 +63,8 @@ app.get('/:config/stream/:type/:id', (req: Request, res: Response) => {
const decodedPath = decodeURIComponent(req.path);
const streamMatch = new RegExp(
`/${config}/stream/(movie|series)/tt([0-9]{7,})(?::([0-9]+):([0-9]+))?\.json`
).exec(decodedPath);
`/stream/(movie|series)/tt([0-9]{7,})(?::([0-9]+):([0-9]+))?\.json`
).exec(decodedPath.replace(`/${config}`, ''));
if (!streamMatch) {
// log after removing config if present
+1 -3
View File
@@ -71,9 +71,7 @@ export default {
const config = components[0];
const decodedPath = decodeURIComponent(url.pathname);
const streamMatch = new RegExp(
`/${config}/stream/(movie|series)/tt([0-9]{7,})(?::([0-9]+):([0-9]+))?.json`
).exec(decodedPath);
const streamMatch = /\/stream\/(movie|series)\/tt(\d{7,})(?::(\d+):(\d+))?.json/.exec(decodedPath.replace(`/${config}`, ''));
if (!streamMatch) {
let path = decodedPath.replace(`/${config}`, '');