This small project is helpful for downloading Coursera courses into your Google Drive via Google Colab. You can use it with given instruction below or given Jupyter Notebook file easily. This module makes it easier to mount your google drive and download all enrolled courses from Coursera.
All enrolled courses can be downloaded by the methods given below,(For more detailed explanations, see the section ''Usage''.)
An overview of CGDD via Google Colab,how to download and use,some basic tips ,explanations and more.
You can download it by using the command below in your terminal.
pip install Coursera-GDrive
If you don't want to waste your time to read this documentation, then just download Jupyter Notebook file, follow the instructions in the given file and run it on your Google Colab.
First of all, you have to know the basics of Python to understand the given instructions below.
from coursera_gdrive import CourseraDownloader
downloader = CourseraDownloader()
from coursera_gdrive import CourseraDownloader
downloader = CourseraDownloader(<folder-name>)
# Example:
# downloader = CourseraDownloader("coursera_files")
Before we go further, we must authenticate ourselves first. For that purpose, we need to CAUTH token which is using for one of the main authentication method by Coursera.
If you are looking for an easy solution, you can install this Browser Extension to find your CAUTH token easily.
coursera.org
in your web browser : cauth = <cauth-token>
# Example:
# cauth = "t-w_itR2tML6ZWA_myKtQeC0JO97SJFkh3PgatWw32t4nrlZrHKsfe2sw"
downloader.login(cauth)
Last one step before download, if you want to see some useful courses list, you have to read this section.
downloader.printEnrolledCourses()
# Prints all enrolled Courses.
downloader.printAllCourses()
# Prints all courses in Coursera.
There is a new method to do that "setSubtitles". Default subtitle languages is "all". If you don't use this method, downloader will download all the available subtitle languages.
downloader.setSubtitles("<language-tag>")
# Example:
downloader.setSubtitles("fr")
# If subtitles is available in French, downloader will download it.
# If the entered language is not available, then it will try to download alternative subtitle language (Default alternative language is English).
There is a method to help you. "showLanguages"
downloader.showLanguages()
- #### Set multiple subtitle languages.
downloader.setSubtitles("
downloader.setSubtitles("fr","de","tr")
- #### Set alternative language and change default common alternative language.
downloader.setSubtitles("
downloader.setSubtitles("fr|de") downloader.setSubtitles("fr|de","tr|it","az") # Multiple Subtitles
- #### If you don't want to state alternative languages for each subtitle one by one, you can use the commonAlternative keyword argument (Default : English).
downloader.set(downloader.setSubtitles("
downloader.setSubtitles("fr", commonAlternative = "de") downloader.setSubtitles("fr","de","tr|en" , commonAlternative = "it")
It's very straight forward. Just call the download method.
downloader.download()
# Downloads all enrolled courses.
Make sure that the class name you are using corresponds to the resource name used in the URL for that class:
https://www.coursera.org/learn/<course-name>/home/welcome
Example:
https://www.coursera.org/learn/
algorithmic-toolbox/home/welcome
downloader.download("<course-name>")
# Downloads just <course-name>.
# Example:
# downloader.download("algorithmic-toolbox")
There are several methods to download multiple courses easily.
downloader.download("<course1>","<course2>","<course3>",...)
# Downloads all the given courses.
- #### Python List Argument
course_list = ["
- #### Passing a text file as an argument
Make sure that,
1. Course names in text file are separated by a newline.
2. Text file is in the save folder. ( Default: COURSERA )
downloader.download("
- #### Passing mixed arguments
course_list = ["
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors who are participated in this project.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.