Skip to main content

Coursera Google Drive Downloader via Google Colab

PyPI contributions welcome Language grade: Python

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''.)

  • Calling download() function,
  • Making a list that includes the course names,
  • Reading from a text file that contains the course names,

Getting Started

An overview of CGDD via Google Colab,how to download and use,some basic tips ,explanations and more.

Prerequisites

  • Coursera-dl Package ( version>=0.11.0 )
  • You have to use Google Colab.
  • If you have never experienced it , then I strongly recommend you to use this powerful and free platform.

Installing

You can download it by using the command below in your terminal.

pip install Coursera-GDrive

Usage

How to use this package without writing code?

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.

If you want to use this package by writing your own code;

First of all, you have to know the basics of Python to understand the given instructions below.

Initializing

  • Initialize the downloader object with default save folder (COURSERA).

     downloader = CourseraDownloader() 
    
  • Initialize the downloader object with save folder in your Google Drive.

    • If downloader can't find given folder, it will automatically creates itself.
    downloader = CourseraDownloader(<folder-name>)
    
    # Example:
    # downloader = CourseraDownloader("coursera_files")
    

Authentication and Authorization

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.

  • How to find your Coursera CAUTH token by using your browser?

    1. First login to coursera.org in your web browser :
    2. For example, in chrome, Go to settings
    3. Advanced
    4. Privacy and Security
    5. Site Settings
    6. Cookies and Site Data
    7. See all cookies and site data
    8. coursera.org -> CAUTH
    9. Copy the content and Paste to <cauth-token>
     cauth = <cauth-token>
    
     # Example:
     # cauth = "t-w_itR2tML6ZWA_myKtQeC0JO97SJFkh3PgatWw32t4nrlZrHKsfe2sw"
    
  • How to login with your CAUTH Token?

     downloader.login(cauth)
    

Courses Lists

Last one step before download, if you want to see some useful courses list, you have to read this section.

  • How to see all enrolled Courses?

     downloader.printEnrolledCourses() 
     # Prints all enrolled Courses.
    
  • How to see all available courses in Coursera?

     downloader.printAllCourses() 
     # Prints all courses in Coursera.
    

Downloading the Courses

  • How to download all of my enrolled course?

    It's very straight forward. Just call the download method.

     downloader.download()
     # Downloads all enrolled courses.
    
  • How to download just one course?

    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")
    
  • How to download one or more course?

    There are several methods to download multiple courses easily.

    • Multiple Course String Argument

     downloader.download("<course1>","<course2>","<course3>",...) 
     # Downloads all the given courses.
    
     # Example:
     # downloader.download("algorithmic-toolbox","crypto","iot","python-ar")
    
    • Python List Argument

     course_list = ["<course1>","<course2>","<course3>",...]
     downloader.download(course_list) 
     # Downloads all courses in python list.
    
     # Example:
     # course_list = ["algorithmic-toolbox","crypto","iot","python-ar"]
     # downloader.download(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("<courselist.txt>") 
     # Downloads all courses in text file.
    
     # Example:
     # downloader.download("course_list.txt")
    
    • Passing mixed arguments

     course_list = ["<course-x>","<course-y>","<course-z>",...]
     downloader.download("<course1>","<course2>","<course3>","<courselist.txt>",course_list) 
     # Downloads all the given courses, courses in text file and courses in python list.
    

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who are participated in this project.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Acknowledgments

Release files for coursera-GDrive 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coursera-GDrive 0.0.3
File Size Uploaded
coursera-GDrive-0.0.3.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coursera-GDrive 0.0.3
File Interpreter ABI Platform
coursera_GDrive-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 33.6 kB

Release files / coursera-GDrive-0.0.3.tar.gz

Download URL coursera-GDrive-0.0.3.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f8f2ec716455d5b2b6e50fcf4e0947844b87473f059b224c946ca3948c12f99d
BLAKE2b-256 checksum
How to use checksums
da3bfb3aabba7bcb49a2ad052839daf89e866a185b3f7b967cea591fae0328a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / coursera_GDrive-0.0.3-py3-none-any.whl

Download URL coursera_GDrive-0.0.3-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
839ca3035e86cd440de930c83838a698a9165c56d361ceb5f9c7ca64e4c0a705
BLAKE2b-256 checksum
How to use checksums
e64ff264e441be66ebaa3e85debbdaf2b902df921ac21c059f4531675909fbc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page