Commit graph

620 commits

Author SHA1 Message Date
Rogério Brito
f44ec2c0d3 README: Reformat some parts of the document. 2015-04-14 00:01:24 -03:00
Rogério Brito
4c687a1ee5 README: Add recommended installation method for Unix-like systems. 2015-04-13 23:39:05 -03:00
Rogério Brito
0fdc0e2cb3 README: Reinforce that pip is the only supported method for dependencies. 2015-04-13 22:54:25 -03:00
Rogério Brito
6ed5324cec README: Reword some parts to be clearer. 2015-04-13 22:53:35 -03:00
Rogério Brito
bbc288650a Minor PEP-8 fixes. 2015-04-09 21:22:57 -03:00
Rogério Brito
0300dc6944 Fix indentation. 2015-04-08 01:29:34 -03:00
Rogério Brito
e524044827 Minor readability changes. 2015-04-08 01:28:50 -03:00
Rogério Brito
04714019aa requirements: Reflect our needed requirements. 2015-04-07 20:00:34 -03:00
Rogério Brito
46320cfec9 coursera: cookies: Restrict TLS to version 1.0.
After a considerable amount of RTFM, I try to summarize here what I
discovered, namely, that the problem is actually a conjunction of many
things:

* Python 2.6 and 2.7.x (with x <= 8) don't define the constants
  `ssl.PROTOCOL_TLSv1_1` and `ssl.PROTOCOL_TLSv1_2`. [They were introduced
  with Python 2.7.9][0]

* Having TLS v1.1 and TLS v1.2 seem to only be available with sufficiently
  new versions of OpenSSL. Again, this is reading from [the Python docs][0].

* urllib3, as a result, doesn't seem to support explicitly specifying which
  which version of TLS to use, as far as I can see it (both by reading the
  reading the code and by reading
  https://github.com/shazow/urllib3/issues/487#issuecomment-59382798).

[0]: https://docs.python.org/2/library/ssl.html?highlight=ssl#ssl.PROTOCOL_TLSv1

Therefore, I guess that the best that we can do so far is to only request
`ssl.PROTOCOL_TLSv1` to be used. While it seems that TLS v1.0 has issues, I
hope that the packages we depend on manage to find a way to negotiate higher
versions of TLS, so that we can change that accordingly in the future.

A not so good alternative to that would be to decide dynamically (and
monkeypatch) urllib3 to see which TLS protocols we have and what we can try
to convice it to be used.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-03-29 17:12:35 -03:00
Rogério Brito
0ad0f4cdf5 Merge branch 'mxamin-sslissue'.
This is a first step to fix the fact that Coursera seems to have disabled
SSLv3 from their site.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-03-29 17:10:56 -03:00
mxamin
83498374d6 Fix SSL Issue
It seems Coursera blocks all connections which are made by SSLv3.
This commit forces all HTTPS connection to use TLS v1.2.
2015-03-28 00:05:12 +04:30
Rogério Brito
081979a7e0 Merge pull request #315 from mxamin/ondemand
On-Demand Courses Download Feature.

Thanks @mxamin for the nice contribution.

Closes #282, #306.
2015-03-20 16:28:42 -03:00
mxamin
baf9c1003a Refacor and Update login Function to V3 API 2015-02-25 14:08:48 +03:30
mxamin
e7ab764521 Add Some Info About On-Demand Courses to README.md file 2015-02-24 14:48:01 +03:30
mxamin
8f2a7ccd0b Remove Single Letter Option for --on-demand Argument 2015-02-24 14:38:54 +03:30
Rogério Brito
7beac4438f Fix PEP-8 issues and improve legibility. 2015-02-23 14:22:47 -03:00
Rogério Brito
402c7d6a64 Merge pull request #316 from vladistan/refactor_and_coverage
Add lots of refactoring and tests.

Courtesy of @vladistan.
2015-02-23 13:53:24 -03:00
Vlad Korolev
a820bada1c Fixes for backward compatibility with python 2.6 2015-02-22 20:59:10 -05:00
Vlad Korolev
10551f012d Extracted find_resrouces_to_get method and made test 2015-02-22 20:46:26 -05:00
Vlad Korolev
4f995c7aa7 Extracted inner functions from download_lectures and made tests for them 2015-02-22 20:46:17 -05:00
Vlad Korolev
ec7d1c1a9c Test for class URL format 2015-02-22 20:46:10 -05:00
Vlad Korolev
cb2e1d2903 Extracted is_course_complete method and added test 2015-02-22 20:45:57 -05:00
Vlad Korolev
2fd5828bd7 Added test for download_about 2015-02-22 20:45:33 -05:00
Vlad Korolev
4a96cf5390 Adjusted ignoreds 2015-02-22 20:44:34 -05:00
mxamin
d824fd4867 Add Order Number to Downloaded Modules Folder Name 2015-02-21 22:09:05 +03:30
mxamin
ddd45e4625 Add On-Demand Course Download Feature
Now we can download on-demand courses like 'calculus1',
'beethoven-piano-sonatas' and etc. We can download these type of courses
by providing `--on-demand` option on command line. ex:
./coursera-dl -u <email> -p <password> --on-demand calculus1

Due to the difference between this type of courses with regular courses of
Coursera, options like '--format' may not work with this feature.
2015-02-21 21:41:44 +03:30
mxamin
1604ff24df Add Basic User Login Procedure
Added an authentication function which implements basic
user login procedure where client clicks `Signin` button
on coursera.org website and fills his/her Email and Password
to enter. In this procedure we use API Login v3 for authentication
and there is no need of `class_name` to fetch `csrftoken`.
This can be useful for future purposes, especially for downloading
`On-Demand` courses.
2015-02-21 09:10:33 +03:30
Rogério Brito
cb89e7c012 fabfile: Future-proof code by making it Python 3 compatible. 2015-01-28 09:37:21 -02:00
Rogério Brito
bf02762907 fabfile: Import only the needed symbols to please pyflakes. 2015-01-28 09:36:24 -02:00
Rogério Brito
256c1e174d fabfile: Reorder the imports to keep PEP-8 sanity. 2015-01-28 09:35:47 -02:00
Rogério Brito
1d9032c5c1 Merge pull request #307 from FedericoCeratto/master
Add a simple Fabric file.

Thanks @FedericoCeratto for the contribution.
2015-01-27 04:16:19 -02:00
Rogério Brito
81eb7833e4 gitignore: Ignore HTML generated coverage data.
[skip-ci]
2015-01-23 01:38:53 -02:00
Rogério Brito
a4911c0d39 test: Add test for random_string. 2015-01-22 22:50:55 -02:00
Rogério Brito
c2cf3d656e travis: Allow failures with Python 3.2.
Making the compatibility with Python 3.2 working when it doesn't accept the
`u` prefix for unicode strings is a pain.

I may try to fix this, but I have yet to see if it is worth it:

    http://python-future.org/unicode_literals.html
2015-01-21 02:13:06 -02:00
Rogério Brito
a3709e9a94 LICENSE: Our license is the LGPLv3+, not the GPLv3.
Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2015-01-21 02:05:30 -02:00
Rogério Brito
2524a2e56f coursera: utils: Remove redundant conversion. 2015-01-19 03:44:30 -02:00
Rogério Brito
45f701888d coursera: utils: More robust decoding of HTML entities. 2015-01-19 03:43:50 -02:00
Rogério Brito
d00815f8b8 tests: Make tests for filenames more informative when failing. 2015-01-19 03:42:55 -02:00
Rogério Brito
0f9e58d7cb tests: Add tests for more filenames. 2015-01-19 03:42:19 -02:00
Rogério Brito
f7e7e26ce5 coursera: cookies: Remove protected method. 2015-01-19 01:46:07 -02:00
Federico Ceratto
6a046c2704 Add a simple Fabric file 2015-01-18 12:02:48 +00:00
Rogério Brito
f362cef711 README: Retouch the wording of the disclaimer.
I am not very happy with the way that I ended up rewording the text and
would gladly accept contributions here.

[ci-skip]
2015-01-17 00:52:19 -02:00
Rogério Brito
8049b38cee gitignore: Fix missing newline at end of file.
[ci-skip]
2015-01-17 00:25:05 -02:00
Rogério Brito
f1656e4f3c Merge pull request #305 from mxamin/issue300
Fix issue#300.

Thanks @mxamin for the nice detective work.
2015-01-17 00:20:52 -02:00
mxamin
e4b05fd246 Fix issue#300
Somehow the order of cookies parameters are an important fact for
coursera!, for example if there are three parameters in cookies
called: 'csrf_token', 'maestro_login_flag' and 'CAUTH' in exactly that
order, coursera doesn't accept it and redirect the request to signin
page, but if without changing parametes values and just changing their
orders: 'maestor_login_flag', 'CAUTH' and 'csrf_token', coursera accepts
it and fetches the requested page.

Updated .gitignore file to ignore virtualenv folders: 'venv2' and
'venv3'.
2015-01-16 17:34:02 +03:30
Rogério Brito
646753e1f6 Merge pull request #304 from FedericoCeratto/patch-2
Add legal disclaimer.
2015-01-14 09:07:08 -02:00
Federico Ceratto
6300d20876 Add legal disclaimer.
Related to #189
2015-01-14 01:28:16 +00:00
Rogério Brito
80a86009f1 Merge pull request #303 from FedericoCeratto/patch-1
Add GPLv3+ LICENSE file.

Thanks @FedericoCeratto.
2015-01-13 22:53:21 -02:00
Rogério Brito
e4117f8949 Complain about modules that are too old to work correctly. 2015-01-12 21:33:23 -02:00
Rogério Brito
d00ef4ac82 Update my copyright years. 2015-01-12 21:32:38 -02:00