forgot about that aspect
This commit is contained in:
parent
a2f13c7e8f
commit
b853814917
|
@ -26,12 +26,14 @@ const cleanup = async (ws: any, videoId: string) => {
|
||||||
const handleUpload = async (ws: any, videoId: string, isChannel: boolean = false) => {
|
const handleUpload = async (ws: any, videoId: string, isChannel: boolean = false) => {
|
||||||
// the pattern of files that have finished downloading is [videoid].mp4, but some extensions are also possible due to
|
// the pattern of files that have finished downloading is [videoid].mp4, but some extensions are also possible due to
|
||||||
// current youtube changes, so we need to make sure the other extensions are also covered
|
// current youtube changes, so we need to make sure the other extensions are also covered
|
||||||
const filePath = fs.readdirSync('./videos/').find(f => f.includes(`${videoId}.`))
|
let filePath = fs.readdirSync('./videos/').find(f => f.includes(`${videoId}.`))
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
ws.send(`DATA - Video file for ${videoId} not found. Skipping.`);
|
ws.send(`DATA - Video file for ${videoId} not found. Skipping.`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filePath = './videos/' + filePath
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ws.send('DATA - Uploading file...');
|
ws.send('DATA - Uploading file...');
|
||||||
const videoUrl = await uploadVideo(filePath);
|
const videoUrl = await uploadVideo(filePath);
|
||||||
|
|
Loading…
Reference in New Issue