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

Add ability to download both video feeds for each lecture #31

Closed henryzt closed 3 years ago

henryzt commented 3 years ago

Should fix #28.

The original methods for getting the video links only returns the first video among the array of videos for each lecture. However, most universities have two video feeds for their echo360 lecture casts (one for the screen and one for the camera).

For example, our university usesecho360.org platform, the URL array crawled by the program already contains all the feeds of the lecture, usually named hd1, hd2 or sd1, sd2, sorted alphabetically, the original methods will only choose hd1 to download.

With this PR it will try to download the first two feeds, it might only work with echo360.org platform and download methods except from_json_mp4. Currently, this behaviour is on by default, maybe we could add another argument in main to make this optional :)

Minor bug fixes

soraxas commented 3 years ago

Hi @henryz00 thank you for your PR.

Yeah I know there are usually multiple sources (hence the sorting) and the reason that only the first one is ever used is that previously in all cases I encountered, both streams are identical. Hence, downloading both streams are wasteful.

I think it's better if you add it as an optional flag as suggested in #28.

henryzt commented 3 years ago

Hi @soraxas no problem! I have added the optional flag and defaults it to false.

I understand that you knew since you wrote it in the comments XD. I guess it's different based on different universities, since some do have a second feeds named hd2 etc.

I'm not quite familiar with the code (and python actually), so if I made a mistake or there exists a better way to do this please tell me, I'll try my best to fix it :)

soraxas commented 3 years ago

Oh and if you can write a very small section in the FAQ about the new flag which enables downloading the alternative stream that would be great.

henryzt commented 3 years ago

Sure thing, I have updated the argument and readme, and had a quick test without any problem :D

soraxas commented 3 years ago

Awesome everything looks good @henryz00, thanks again for the PR!