ikeboy / pluralsight-scraper

Pluralsight video downloader
https://www.knyz.org/blog/post/pluralsight-scraper-released/
GNU General Public License v2.0
139 stars 50 forks source link

Feature request: resume after error/interruption #21

Open gillespieza opened 4 years ago

gillespieza commented 4 years ago

Currently, if the script breaks, I have to restart downloading from the beginning of a course. I would love to be able to resume from where it broke.

Perhaps it could skip existing files, even if I have to manually confirm Y/N for overwriting existing files?

Aryangh1379 commented 4 years ago

Currently, if the script breaks, I have to restart downloading from the beginning of a course. I would love to be able to resume from where it broke.

Perhaps it could skip existing files, even if I have to manually confirm Y/N for overwriting existing files?

Yeah, i have the same problem, i really do need this bot, i hope the developer could update it so often.

vezaynk commented 4 years ago

I'm a pretty busy guy. Right now I did the bare minimum to get it working again. I'm hoping on other people contributing to the code-base.

All that needs to happen to make this work is a .slice(numberOfFilesPresent-1) on the list of videos to download and and adjust the indexes of the file to be index + numberOfFilesPresent) or some variant of that.

Aryangh1379 commented 4 years ago

I'm a pretty busy guy. Right now I did the bare minimum to get it working again. I'm hoping on other people contributing to the code-base.

All that needs to happen to make this work is a .slice(numberOfFilesPresent-1) on the list of videos to download and and adjust the indexes of the file to be index + numberOfFilesPresent) or some variant of that.

how exactly should I do it ? I'm not a programmer

vezaynk commented 4 years ago

@aryangh I'm actually curious, what are you doing with pluralsight if not for programming?

Aryangh1379 commented 4 years ago

@knyzorg, Pluralsight is not merely for leaning programming AFAIK, I'm trying to download Linux learning videos with pluralsight.

gillespieza commented 4 years ago

umactually this shouldn't be needed, because your code already checks the local filesystem for if the video already exists?

if (!fs.existsSync(file)) { console.log('Downloading video file for: ${video.title + ".mp4"}'); const data = await fetch(video.url); const fileStream = fs.createWriteStream(file); data.body.pipe(fileStream); }

However, with every PL course I've tried, I get a few videos (between 7 and 15), then the script breaks, and if I restart it, it starts again from video 1, and breaks at the same spot.

coeur85 commented 4 years ago

any one cares to write an sample code to start downloading from video index 13 , so it skips checking for the previous videos ?