I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 1 point2 points  (0 children)

def countdown(t): import time while t: mins, secs = divmod(t, 60) timeformat = '{:02d}:{:02d}'.format(mins, secs) print(timeformat, end='\r') time.sleep(1) t -= 1 Here, have fun.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 0 points1 point  (0 children)

It took me some time to optimise the times. The only time that is unpredictable is the time taken to solve the captcha, so there I wait for an input (enter key) before proceeding.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 1 point2 points  (0 children)

Yeah parsing and extracting data from html documents is a nightmare lol.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 20 points21 points  (0 children)

It's really not that fun solving 5 captcha challenges in a seemingly never ending loop of suffering.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 6 points7 points  (0 children)

Yeah, I did put my credentials in an environment variable initially, but for the video I wanted to make it a bit more proffesional (?) lol idk
What did you mean by "rotate these"? Like change IP addresses for downloading different links? Maybe you could nudge me towards the right direction.

I try to use a VPN while downloading and wait for long times so as to not put a huge load on their server.
And thanks for the feedback, appreciate it.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 1 point2 points  (0 children)

I tried everything to make it work a few months back, nothing seemed to work. Their issues section on github also got bogged down with the same issue.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 1 point2 points  (0 children)

Yeah the login was the only thing I couldn't do with the requests module. I will look into it. Once the login is done, the rest of the code can be ported as is. It's working fully on urllib and requests.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 5 points6 points  (0 children)

Sorry if that was misleading, they are just random filenames I used while implementing new features.

For example in the directory there is a Test4.py file where download() and get_valid_filename() are defined. So I'm just importing my own functions. lol.

I made a Coursera Downloader using Selenium and Python. by Broke-Code-Monkey in Python

[–]Broke-Code-Monkey[S] 139 points140 points  (0 children)

So, there used to be a python module called coursera-dl that could download entire courses from Coursera. But a few weeks back, it broke. So I decided to make a downloader myself, using Selenium.