sholiday / desire2download Goto Github PK
View Code? Open in Web Editor NEWDownload all of the content from the University of Waterloo's Desire2Learn LMS
Home Page: http://stephenholiday.com/desire2download/
License: Apache License 2.0
Download all of the content from the University of Waterloo's Desire2Learn LMS
Home Page: http://stephenholiday.com/desire2download/
License: Apache License 2.0
I have a class named "AFM 131/ARBUS 101", the forward slash is being replaced here, which results in a folder named AFM 131\
being created, inside that is ARBUS 101 - Fall 2012
, and inside that are all the files.
I'm not sure what's a good way to deal with this. I don't think it's possible to create a folder with a / in the name in unix. Maybe x.replace('/', ', ')
?
So, I recently encountered this error:
...
- PHYS 258 - Spring 2012/Module 5. Tests/Q2(FS).pdf (Already Saved)
PHYS 256 - Spring 2012
- PHYS 256 - Spring 2012/Module 1. Welcome/Welcome_2012.pdf (Already Saved)
Traceback (most recent call last):
File "/usr/bin/d2d", line 8, in <module>
load_entry_point('Desire2Download==0.1.2', 'console_scripts', 'd2d')()
File "/usr/bin/d2d.py", line 163, in main
d2d.download_tree(document_tree)
File "/usr/lib/python2.7/site-packages/desire2download.py", line 193, in download_tree
self.download_tree(node, path)
File "/usr/lib/python2.7/site-packages/desire2download.py", line 193, in download_tree
self.download_tree(node, path)
File "/usr/lib/python2.7/site-packages/desire2download.py", line 198, in download_tree
self.download_file(root['name'], root['url'], path)
File "/usr/lib/python2.7/site-packages/desire2download.py", line 240, in download_file
content = self.br.open_novisit(clean_url).read()
File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 199, in open_novisit
return self._mech_open(url, data, visit=False, timeout=timeout)
File "/usr/lib/python2.7/site-packages/mechanize/_mechanize.py", line 230, in _mech_open
response = UserAgentBase.open(self, request, data)
File "/usr/lib/python2.7/site-packages/mechanize/_opener.py", line 193, in open
response = urlopen(self, req, data)
File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 344, in _open
'_open', req)
File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 332, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1170, in https_open
return self.do_open(conn_factory, req)
File "/usr/lib/python2.7/site-packages/mechanize/_urllib2_fork.py", line 1118, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
[ktalwar@ubuntu]
...
This I believe is happening because for some reason, the link its trying to download is actually a URL redirect to some section of uwaterloo.ca but is being classified as a file in this line.
Right now I'm running the script with this fix in place and its doing the job.
desire2download.py - Line 188
for node in root['children']:
try:
self.download_tree(node, path)
except:
pass
It looks like you already put this up on PyPI, so why not include instructions to install this with pip or easy_install?
It means people don't have to figure out how to download or clone the repo.
Sadface.
The RegEx is not detecting some courses. I'm adding a patch
Courses
AMATH 473/AMATH 673/PHYS 454 - Fall 2012
PHYS 360A/PHYS 360B/PHYS 460A/PHYS 460B - Fall 2012
Fix
re.match('[A-Z]+ [0-9A-Z/\s]{2,45} - [A-Z][a-z]+ 20[0-9]{2}', link.text)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.