soraxas / echo360

Commandline tool for automated downloads of echo360 videos hosted by university
https://cs.tinyiu.com/echo360
MIT License
262 stars 51 forks source link

Cloud login issue #33

Closed vrossum closed 3 years ago

vrossum commented 3 years ago

Hi Thanks for this software! I'm trying to use it as a teacher at Uni. Nottingham in the UK which uses the cloud version. The problem is that the login does not work, probably because https://echo360.org.uk/section/82a37ff6-132c-4300-91dd-48eb0a18214d/syllabus points to https://login.echo360.org.uk which points to https://login.pingone.com/ (a centralized login).

But this prompt does not show, instead a 404 error is thrown.

When using an -existing- browser on https://echo360.org.uk/section/82a37ff6-132c-4300-91dd-48eb0a18214d/syllabus the login goes as expected via poingone.com, the 404 is resolved and syllabus has content.

Log attached.

log.txt

soraxas commented 3 years ago

Hi Mark thank you for reporting the issue.

This might be related to #32, which is currently staled without responses.

There are a few things that came into my mind. First thing is that it might be due to the credentials had not been set when accessing the page. Can you try to run it again with the --manual flag to ensure you had been properly logged in before continuing the script, i.e.,

python3 echo360.py  https://echo360.org.uk/section/82a37ff6-132c-4300-91dd-48eb0a18214d/home --debug --firefox --manual

(type continue in the terminal after logging in within the browser)

Secondly, if the above didn't affect the final result, it is strange that accessing https://echo360.org.uk/section/XXXX/syllabus returns 404 even though the login is successful. It might be due to some browser compatibility? If you have chrome installed as well you can try to see if that make any differences. Finally, I'm not sure if it is due to the user agent string set within the script that causes the 404 results. Is that any way that you can successfully access the syllabus within the controlled browser, as opposed to the existing browser?

vrossum commented 3 years ago

Thanks, with manual it works!

I realize I was not clear. Without manual, I get the 404 error because I am not presented with a login prompt. Echo.org.uk redirects the login from login.echo.uk to pingone once you give your username. In the manual mode that works ok, but without manual, it fails.

soraxas commented 3 years ago

Thanks @vrossum for reporting back, and I'm glad that it works!

The automatic redirection works by checking for the existence of some special cookies set by the SSO. Perhaps the detection mechanism is not sophisticated enough and had performed a redirection before a successful login. I will make the manual mode default to avoid similar confusion.