coursera-dl / coursera-dl

Script for downloading Coursera.org videos and naming them.
GNU Lesser General Public License v3.0
9.38k stars 2.21k forks source link

trouble with --on-demand flag macosx yosemite 10.10.5 and python 2.7 #409

Closed gyasis closed 9 years ago

gyasis commented 9 years ago

when using coursera-dl what I'm assuming is a on demand course at this address:https://www.coursera.org/learn/python/home/welcome

there are a lot of courses now with this url and general class name, no longer numbers(are these on demand) so when entering a command without the on demand flag, it throws "class not found result" If i enter command with the --on-demand flag I get this:

coursera-dl: error: unrecognized arguments: --on-demand

I've tried combination of numbers, as in adding 001 to the end of some of these classes...python was only an example but there are many classes that I've tried, but its just saying that there is no --on-demand argument.

balta2ar commented 9 years ago
  1. Make sure you're using the latest version of coursera-dl. If you installed it with pip, do pip install --upgrade coursera-dl; if you use git, do git pull.
  2. If it still breaks, please show the complete command line. I need to see how you run it. 16 сент. 2015 г. 1:33 AM пользователь "gyasis" notifications@github.com написал:

when using coursera-dl what I'm assuming is a on demand course at this address:https://www.coursera.org/learn/python/home/welcome https://www.coursera.org/learn/python/home/welcome

there are a lot of courses now with this url and general class name, no longer numbers(are these on demand) so when entering a command without the on demand flag, it throws "class not found result" If i enter command with the --on-demand flag I get this:

coursera-dl: error: unrecognized arguments: --on-demand

I've tried combination of numbers, as in adding 001 to the end of some of these classes...python was only an example but there are many classes that I've tried, but its just saying that there is no --on-demand argument.

— Reply to this email directly or view it on GitHub https://github.com/coursera-dl/coursera-dl/issues/409.

gyasis commented 9 years ago

I pulled with git, here is a new error that is reproducible with multiple classes

gamin$ coursera-dl -u user -p pass --on-demand python Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==3.1.1', 'console_scripts', 'coursera-dl')() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2682, in load_entry_point return ep.load() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2355, in load return self.resolve() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2361, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/courseradownloader/courseradownloader.py", line 98 print "Invalid week filter, should be a comma separated list of integers", e ^ SyntaxError: Missing parentheses in call to 'print' gamin$ coursera-dl -u user -p pass --on-demand website-coding Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==3.1.1', 'console_scripts', 'coursera-dl')() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 558, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2682, in load_entry_point return ep.load() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2355, in load return self.resolve() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/init.py", line 2361, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/courseradownloader/courseradownloader.py", line 98 print "Invalid week filter, should be a comma separated list of integers", e ^ SyntaxError: Missing parentheses in call to 'print'

rbrito commented 9 years ago

Hi everybody.

On Sep 15 2015, Yuri Bochkarev wrote:

  1. Make sure you're using the latest version of coursera-dl. If you installed it with pip, do pip install --upgrade coursera-dl; if you use

Unfortunately, this is almost correct, but not quite, due to the existence of more than one project with the same name.

https://github.com/dgorissen/coursera-dl

was first to register the name coursera-dl on PyPI, which meant that I was not able to use that name, only coursera.

So, the "correct" usage of pip (at least if you want to use our project) is:

pip install coursera

Note the lack of the -dl suffix above. This is the only place were we are called coursera only and not coursera-dl (OK, and the main module of our project, but that's generally not important for users).

Note that the other project does not support Python 3, while ours does (yes, I spent considerable time making this happen, with a lot of help from @jonasdt). I also don't know if they support on-demand courses (the last time I saw, they didn't, but they may have added that in recent times).

If anybody has installed the pip package coursera-dl, please uninstall it first and then install our project:

pip uninstall coursera-dl
pip install --upgrade coursera

Or, better yet, use a virtual environment with the latest version that I have released on PyPI:

pip install --upgrade --pre coursera

git, do git pull.

That's a good option, since I usually don't let our own project have any breakages that I know of (or that are "bad"), as what I use personally is our git tree.

  1. If it still breaks, please show the complete command line. I need to see how you run it.

Yes, with the --debug option also, please.

Thanks,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

rbrito commented 9 years ago

Hi.

On Sep 17 2015, Gyasi Sutton wrote:

I pulled with git, here is a new error that is reproducible with multiple classes (...)

gamin$ coursera-dl -u user -p pass --on-demand python

You aren't necessarily using the command from your current working directory. You should have typed with ./ as a prefix of coursera-dl.

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==3.1.1', 'console_scripts', 'coursera-dl')()

Here you are able to see two things:

1 - that the program executed comes from your system installation (see my comment above regarding the missing ./ in front of coursera-dl). 2 - that the program executed is not our program, but from another project. I have only released up to version 0.1.0a3 on PyPI.

You are welcome to try my/our project. Yes, it is confusing. I know. But that's life.

print "Invalid week filter, should be a comma separated list of integers", e

We support Python 3, BTW.

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

gyasis commented 9 years ago

I followed your instructions...

It seems that my Mac was a mess of conflicting paths and links from using macports and homebrew it was requesting processes from python 2.7 though I installed the latest 3.5 on my system... Started using a virtualenv and installed like you said, got every thing up and running but now I have a could not authenticate error... On Sep 17, 2015 6:24 PM, "Rogério Brito" notifications@github.com wrote:

Hi.

On Sep 17 2015, Gyasi Sutton wrote:

I pulled with git, here is a new error that is reproducible with multiple classes (...)

gamin$ coursera-dl -u user -p pass --on-demand python

You aren't necessarily using the command from your current working directory. You should have typed with ./ as a prefix of coursera-dl.

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==3.1.1', 'console_scripts', 'coursera-dl')()

Here you are able to see two things:

1 - that the program executed comes from your system installation (see my comment above regarding the missing ./ in front of coursera-dl). 2 - that the program executed is not our program, but from another project. I have only released up to version 0.1.0a3 on PyPI.

You are welcome to try my/our project. Yes, it is confusing. I know. But that's life.

print "Invalid week filter, should be a comma separated list of integers", e

We support Python 3, BTW.

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

— Reply to this email directly or view it on GitHub https://github.com/coursera-dl/coursera-dl/issues/409#issuecomment-141272278 .

gyasis commented 9 years ago

Here's the error message with the debug, now after using an virtual environment, plus some extra info, I changed the username and password on here but I've checked and double checked my password, which works on the site.

(coursera_env3)gyasis-MacBook-Pro:courses gyasisutton$ which python

/Users/gyasisutton/Documents/environments/coursera_env3/bin/python

(coursera_env3)gyasis-MacBook-Pro:courses gyasisutton$ pip list

beautifulsoup4 (4.4.0)

coursera (0.0.3)

html5lib (1.0b8)

keyring (5.4)

pip (7.1.2)

pyasn1 (0.1.8)

requests (2.7.0)

setuptools (18.2)

six (1.9.0)

urllib3 (1.12)

wheel (0.24.0)

(coursera_env3)gyasis-MacBook-Pro:courses gyasisutton$ coursera-dl -u gatu@gmail.com -p pass1234 --on-demand calculus1 --debug

root[main] Downloading class: calculus1

root[login] Initiating login.

root[login] There were no .coursera.org cookies to be cleared.

root[login] Forging cookie header: csrftoken=rQxsnT9jF7J6m1br9sC1; csrf2_token_KsxmvQVv=EYP4lR9yUH0sE5kxGamXYv9z.

requests.packages.urllib3.connectionpool[_new_conn] Starting new HTTPS connection (1): www.coursera.org

requests.packages.urllib3.connectionpool[_make_request] "POST /api/login/v3 HTTP/1.1" 401 None

root[main] Could not authenticate: Cannot login on coursera.org.

(coursera_env3)gyasis-MacBook-Pro:courses gyasisutton$ python --version

Python 3.5.0

(coursera_env3)gyasis-MacBook-Pro:courses gyasisutton$

On Thu, Sep 17, 2015 at 6:23 PM, Rogério Brito notifications@github.com wrote:

Hi.

On Sep 17 2015, Gyasi Sutton wrote:

I pulled with git, here is a new error that is reproducible with multiple classes (...)

gamin$ coursera-dl -u user -p pass --on-demand python

You aren't necessarily using the command from your current working directory. You should have typed with ./ as a prefix of coursera-dl.

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.5/bin/coursera-dl", line 9, in load_entry_point('coursera-dl==3.1.1', 'console_scripts', 'coursera-dl')()

Here you are able to see two things:

1 - that the program executed comes from your system installation (see my comment above regarding the missing ./ in front of coursera-dl). 2 - that the program executed is not our program, but from another project. I have only released up to version 0.1.0a3 on PyPI.

You are welcome to try my/our project. Yes, it is confusing. I know. But that's life.

print "Invalid week filter, should be a comma separated list of integers", e

We support Python 3, BTW.

Regards,

Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://cynic.cc/blog/ : github.com/rbrito : profiles.google.com/rbrito DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br

— Reply to this email directly or view it on GitHub https://github.com/coursera-dl/coursera-dl/issues/409#issuecomment-141272278 .

gyasis commented 9 years ago

the issue was resolved...running a clean virtualenv

rbrito commented 9 years ago

Excellent, @gyasis. Thank you very much.

If you think that our documentation (https://github.com/coursera-dl/coursera-dl/#coursera-downloader) could be improved in some way to avoid such mistakes in the future, please let us know.

gyasis commented 9 years ago

The documentation is good it was just an issue of having python libraries routed to the right program.. Having a python virtualenv worked wonders On Sep 23, 2015 3:04 PM, "Rogério Brito" notifications@github.com wrote:

Excellent, @gyasis https://github.com/gyasis. Thank you very much.

If you think that our documentation ( https://github.com/coursera-dl/coursera-dl/#coursera-downloader) could be improved in some way to avoid such mistakes in the future, please let us know.

— Reply to this email directly or view it on GitHub https://github.com/coursera-dl/coursera-dl/issues/409#issuecomment-142713313 .