fix pub vids

This commit is contained in:
bingus_violet 2024-04-17 08:44:46 -05:00
parent e3eb2130ba
commit 074e06236a

View file

@ -50,6 +50,9 @@ app.get("/watch/*", (req, res) => {
var video = req.params[0] var video = req.params[0]
var absPath = path.join(directory, video) var absPath = path.join(directory, video)
if (!fs.existsSync(absPath)) {
absPath = path.join(pubDir, video)
}
var html = fs.readFileSync(path.join(__dirname, 'resources/watch.html')).toString() var html = fs.readFileSync(path.join(__dirname, 'resources/watch.html')).toString()
@ -72,6 +75,10 @@ app.get("/video/*", (req, res) => {
var video = req.params[0] var video = req.params[0]
var vidPath = path.join(directory, video) var vidPath = path.join(directory, video)
if (!fs.existsSync(vidPath)) {
vidPath = path.join(pubDir, video)
}
const range = req.headers.range const range = req.headers.range
const videoPath = vidPath; const videoPath = vidPath;
const videoSize = fs.statSync(videoPath).size const videoSize = fs.statSync(videoPath).size