soraxas / echo360

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

Echo360 Coud platform download error #29

Closed AlvinChen2020 closed 4 years ago

AlvinChen2020 commented 4 years ago

I tried to download videos from Echo360 platform on a PC. First it brings up a browser window but does not allow me to manually enter SSO login webpage. Then I pre-login to my school's SSO website and repeat the procedure. Now it stops at the webpage "https://echo360.org/section/my_course_uuid/syllabus which returns "404 Not Found.

The log from the prompt is shown below.

> Echo360 Cloud platform detected
> This implies setup_credential, and using web_driver
>> Please login with your SSO details and type continue when logged in.
-----------------------------------------------------------------

DevTools listening on ws://127.0.0.1:12565/devtools/browser/262b3662-5b3a-4046-981b-9078acb096f9
 >> After you finished logging into echo360 cloud, the window should be automatically redirected and continued. If it got stuck, please contact the author :)
>> I'm gonna assume you are responsible enough to had finished logged in by now ;)
>> Retrieving echo360 Course Info... [2912:4844:0901/120337.411:ERROR:device_event_log_impl.cc(208)] [12:03:37.411] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
Traceback (most recent call last):
  File "echo360.py", line 7, in <module>
    sys.exit(main())
  File "C:\Users\username\Documents\GitHub\echo360\echo360\main.py", line 259, in main
    downloader.download_all()
  File "C:\Users\username\Documents\GitHub\echo360\echo360\downloader.py", line 189, in download_all
    videos = self._course.get_videos().videos
  File "C:\Users\username\Documents\GitHub\echo360\echo360\course.py", line 128, in get_videos
    course_data_json = self._get_course_data()
  File "C:\Users\username\Documents\GitHub\echo360\echo360\course.py", line 196, in _get_course_data
    raise Exception("Error: Failed to get m3u8 info for EchoCourse!")
Exception: Error: Failed to get m3u8 info for EchoCourse!
bwhurd commented 4 years ago

Hi, I really don't know what I'm doing, but I was able to fix the issue by editing the file named "downloader.py". It just adds a 20 second pause. Then I maximized the browser window to login that was made small and quickly logged in. I use the --chrome flag. Not sure if that is necessary. Good luck!

I added the following line with no indent to line 6 (inserted between "import re" line and "from .course import EchoCloudCourse" line): import time

and I inserted the following line on line 181 (preceded by 3 indents) between "if self.setup_credential:" (line 180) and " sys.stdout.write(">> I'm gonna assume you are responsible enough to had " time.sleep(20)

AlvinChen2020 commented 4 years ago

Hi, I really don't know what I'm doing, but I was able to fix the issue by editing the file named "downloader.py". It just adds a 20 second pause. Then I maximized the browser window to login that was made small and quickly logged in. I use the --chrome flag. Not sure if that is necessary. Good luck!

I added the following line with no indent to line 6 (inserted between "import re" line and "from .course import EchoCloudCourse" line): import time

and I inserted the following line on line 181 (preceded by 3 indents) between "if self.setup_credential:" (line 180) and " sys.stdout.write(">> I'm gonna assume you are responsible enough to had " time.sleep(20)

Although the mere suggested modification does not solve the problem, the extended time (I use 40 seconds) does help to find a workaround.

Instead of using SSO login, I actually logged in directly using my echo360 account. Since I never did that from echo306 webpage, I used the same email as with my school's SSO, and retrieved the password by going through "I forget the password" option. After login, I had to change my role from "instructor" to "student". Then the magic happens and the donwloading starts.

Thanks!

soraxas commented 4 years ago

Apology for the confusion as it seems like there are issues with the credential being not sufficient for some institutions?

The module works like this:

  1. If it detected the link is a echo360.org link, it will hang in the background within a loop.
  2. A browser instance will be spawned to allow you to login with your institution's SSO.
  3. It will keep checking in the background if the login token is set within the browser cookies
  4. When (3) is met, it will then proceed to retrieve your course's data.

This works for the most part as this issue is the first time I'm hearing about it. It seems like for you two's case the module thought the login token is set (step 3) while it was still not sufficient to access the course.

I will add in an extra flag --manual to allow you to manually disable step 3 and provide you have enough time to login (instead of using time.sleep(..)) and continue the process manually once you are done logging in.

soraxas commented 4 years ago

You can now run the module with

python echo360.py <echo360.org-URL> --manual

to disable automatic detection of credentials. One you have logged in, type

continue

in your terminal to continue.

bwhurd commented 4 years ago

thanks! really appreciate it.