dgorissen / coursera-dl

A script for downloading course material (video's, pdfs, quizzes, etc) from coursera.org
http://dirkgorissen.com/2012/09/07/coursera-dl-a-coursera-download-script/
GNU General Public License v3.0
1.74k stars 300 forks source link

Added non-wrapper GUI #80

Closed ghost closed 11 years ago

ghost commented 11 years ago

dl

Feedback would be much appreciated.

ghost commented 11 years ago

Fixed custom html parsers bug in commit 9b151b5

dgorissen commented 11 years ago

Thanks for this. I have had a first quick look through. Main comment: I would like to keep the original script and the gui separate which means avoiding the base script having a dependence on tk/gui (so that those dependencies remain optional). So I would suggest writing your gui script as a wrapper that wraps the original one without introducing extra dependencies or impacting existing users (if the gui is no longer maintained for some reason for example). I will refactor the original script a bit so its cleaner and provides the necessary hooks. Your gui can then be deployed as a separate script (coursera-dl-gui or something).

ghost commented 11 years ago

@dgorissen yeah That would be better for everyone, I will make the necessary changes but it'll take some time as I'm sorta busy these days

ghost commented 11 years ago

I rewrote the code using the latest commit 9dfcc2865c348fc10f5600324346902d8bce8119, Now the GUI is just a wrapper for the script and wouldn't have any effect on existing users, To run the GUI just execute GUI.py . I haven't tested the GUI on linux, anyway I hope you find the latest piece of code interesting and hope to hear any feedback :)

ghost commented 11 years ago
$ python courseradownloader/GUI.py # 834c2e8ff

It works, but it's ugly.

Throws this if I don't do 'select folder' before the continue button

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "courseradownloader/GUI.py", line 76, in submit_data
    self.data = [self.username.get(),self.password.get(),self.courseName.get().split(),self.destination,self.ignoreFiles.get(),self.pro    xy,self.trim.get(),self.reverse.get(),self.parser_mod]
AttributeError: Interface instance has no attribute 'destination'
ghost commented 11 years ago

@zamabe I haven't tested this on any other OS than windows, and I'm currently busy and I'm considering revamping and upgrading so that not a single line in courseradownloader.py is affected which would, hopefully also fix that certain issue. Also please do help to add GUI if possible to this branch or my branch

Therefore I'm closing this pull request...