Closed dori921 closed 2 years ago
Hey @dori921
You achive it very easily by using setInterval(startUploadingVideos,300000)
setInterval(fun,delay)
Complete login can be as follows
const videosFolder = "/path_of_your_videos_folder/";
const startUploadingVideos = () => {
fs.readdir(videosFolder, (err, files) => {
files.forEach(file => {
//if your folder also has other files then only upload the video files like mp4
if(file.includes(".mp4")){
videos_array.push({
path: destFolder+file,
title: 'Your video title here.',
description: 'Your video description here.',
onSuccess:onVideoUploadSuccess, skipProcessingWait: true, onProgress: (progress) => { console.log('progress', progress) }
})
}
});
});
upload (credentials, videos_array, {headless:false}).then(console.log)
}
setInterval(startUploadingVideos,300000)
Hello.Thanks for your answer. Im getting this error.
Opps missed an equal operator.
change this line
const startUploadingVideos () => {
to this
const startUploadingVideos = () => {
Thanks a lot for your answers,I am getting errors again
This is my full code.
const { upload } = require('youtube-videos-uploader');
const credentials = { email: 'myemail@gmail.com', pass: 'mypassword' }
const videosFolder = "C:/Users/dori/Downloads/";
const startUploadingVideos = () => {
fs.readdir(videosFolder, (err, files) => {
files.forEach(file => {
//if your folder also has other files then only upload the video files like mp4
if(file.includes(".mp4")){
videos_array.push({
path: destFolder+file,
title: 'Your video title here.',
description: 'Your video description here.',
onSuccess:onVideoUploadSuccess, skipProcessingWait: true, onProgress: (progress) => { console.log('progress', progress) }
})
}
});
});
upload (credentials, videos_array, {headless:false}).then(console.log)
}
setInterval(startUploadingVideos,300000)
change destFolder with videosFolder to correctly set the path. Rest of the code looks good.
Im having the same error :/
You didn't imported the fs library your full code should be
const { upload } = require('youtube-videos-uploader');
const credentials = { email: 'myemail@gmail.com', pass: 'mypassword' }
const fs = require('fs');
const videosFolder = "C:/Users/dori/Downloads/";
const startUploadingVideos = () => {
fs.readdir(videosFolder, (err, files) => {
files.forEach(file => {
//if your folder also has other files then only upload the video files like mp4
if(file.includes(".mp4")){
videos_array.push({
path: videosFolder+file,
title: 'Your video title here.',
description: 'Your video description here.',
onSuccess:onVideoUploadSuccess, skipProcessingWait: true, onProgress: (progress) => { console.log('progress', progress) }
})
}
});
});
upload (credentials, videos_array, {headless:false}).then(console.log)
}
setInterval(startUploadingVideos,300000)
Im getting this one now
Im getting this one now
Go learn javascript then come back to this.
@r8u i didn't asked you
Hey @dori921 I am sorry to say @r8u said right. You have to learn javascript first because these are basic errors.
Well.. define video_array on top of the function.
@enmohsinali Thanks a lot for your answers
Your welcome.
Paid support is available for quick resolution & help.
For paid support, please write mail to youtube-uploader@datascraping.pp.ua
Hello.Im trying to do this by myself but i couldnt,Can anyone help me please ?