diff --git a/index.js b/index.js index 768ef66..b91fe48 100644 --- a/index.js +++ b/index.js @@ -72,35 +72,6 @@ app.get("/watch/*", (req, res) => { res.send(html) }) -app.get("/video/*", (req, res) => { - var video = req.params[0] - var vidPath = path.join(directory, video) - - if (!fs.existsSync(vidPath)) { - vidPath = path.join(pubDir, video) - } - - const range = req.headers.range - const videoPath = vidPath; - const videoSize = fs.statSync(videoPath).size - const chunkSize = 1 * 1e6; - const start = Number(range.replace(/\D/g, "")) - const end = Math.min(start + chunkSize, videoSize - 1) - const contentLength = end - start + 1; - const headers = { - "Content-Range": `bytes ${start}-${end}/${videoSize}`, - "Accept-Ranges": "bytes", - "Content-Length": contentLength, - "Content-Type": "video/mkv" - } - res.writeHead(206, headers) - const stream = fs.createReadStream(videoPath, { - start, - end - }) - stream.pipe(res) -}) - app.get("/download/*", (req, res) => { var download = req.params[0] var downloadPath = path.join(directory, download) diff --git a/resources/watch.html b/resources/watch.html index f70262d..6afb6e3 100644 --- a/resources/watch.html +++ b/resources/watch.html @@ -27,9 +27,8 @@

Back

{VID_INFO}

Download -
Compatibility Video player

- +

Please note that the video player is unfinished, most commonly having issues on iOS devices.