rojter-tech / pluradl.py

Automated download of Pluralsight courses
MIT License
2 stars 0 forks source link

pluraexercise: Check Files Before Opening Browser #27

Closed prikhi closed 4 years ago

prikhi commented 4 years ago

Heya, been enjoying the automated exercise downloading since you added parameters to the exercise script.

I've got a bash script that sources my virtualenv, runs pluradl & then pluraexercise. Everytime I kill the pluradl download, Chrome pops up and does nothing because I've already downloaded all the exercises.

Would it be possible to do the file check before opening Chrome? I.e., see if there's anything to download and only start selenium/chrome if there are missing exercise files?

Thanks!

rojter-tech commented 4 years ago

Heya, been enjoying the automated exercise downloading since you added parameters to the exercise script.

I've got a bash script that sources my virtualenv, runs pluradl & then pluraexercise. Everytime I kill the pluradl download, Chrome pops up and does nothing because I've already downloaded all the exercises.

Would it be possible to do the file check before opening Chrome? I.e., see if there's anything to download and only start selenium/chrome if there are missing exercise files?

Thanks!

Yes, this part of the program is not "fully" developed yet. There is already a check for which exercise downloads thats either is already finished or that was invalid due to subcription details (tagged_courses.txt will be created for this purpose). I am planning to implement more wraparounds related to this issue but the dependecy of Selenium will probably still be there, thus this feature will be regarded only as a complementary tool to the main functionality to extract the video content itself.

prikhi commented 4 years ago

Right, I just meant the logic is currently like:

start selenium
for each course:
  if not already downloaded:
    download course
stop selenium

Instead, could we do something like:

for each course:
  if already downloaded:
    remove from courses to download
if there are courses to download:
  start selenium
  foreach course to download:
    download course
  stop selenium

That way selenium only gets started when there are actually things for it to do.

rojter-tech commented 4 years ago

Right, I just meant the logic is currently like:

start selenium
for each course:
  if not already downloaded:
    download course
stop selenium

Instead, could we do something like:

for each course:
  if already downloaded:
    remove from courses to download
if there are courses to download:
  start selenium
  foreach course to download:
    download course
  stop selenium

That way selenium only gets started when there are actually things for it to do.

Ah, yes that's a great idea :). Thank you for your input.

rojter-tech commented 4 years ago

@prikhi btw, it would possible yes, and not too hard to fix, I will put it up as a TODO :P

rojter-tech commented 4 years ago

@prikhi wow, thank you very much :)