Udemy automation, supercharged
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
An automation tool that reads Reddit posts from various relevant subreddits (r/udemyfreebies, r/udemyfreeebies, r/udemyfreecourses), extracts course links from middleman websites, converts them into direct Udemy links with coupons, and automates the enrollment process into free courses.
-
A Chromium-based browser (sorted from best-supported to least):
- Google Chrome is fully supported and recommended.
- Brave Browser works but might break with newer Brave versions.
Create a Reddit bot and get environment variables
- Visit Third-party app authorizations
- Click on create another app button at the bottom
- Set name to
Udemate - Select script
- Set description to an appropriate description (e.g. repo description)
- Set redirect uri to
http://localhost:8080
📝 Note: It is preferable to use a Reddit account that doesn't have 2FA configured. If you have 2FA enabled for your Reddit account, the script will provide you with a link that you need to click on to generate a Reddit refresh token and authorize access.
Udemate was tested on Windows 11.
-
Clone the repo
git clone https://github.com/muhammadazzazy/udemate.git
-
Navigate into the project directory
cd udemate -
Create a .env file
# Reddit config # Required. REDDIT_CLIENT_ID="" # Required. REDDIT_CLIENT_SECRET="" # Optional. Default is 'script:Udemate:v1.0 (by u/kemitche)'. REDDIT_USER_AGENT="" # Required if 2FA is not enabled. REDDIT_PASSWORD="" # Required if 2FA is not enabled. REDDIT_USERNAME="" # Optional. Default is 500. UDEMY_FREEBIES_LIMIT=1000 UDEMY_FREEEBIES_LIMIT=0 UDEMY_FREE_COURSES_LIMIT=0 # Browser config BROWSER_MAJOR_VERSION=142 # Required if you want to enroll in courses with a user profile. USER_DATA_DIR="C:\\Users\\username\\AppData\\Local\\Google\\Chrome\\User Data\\Udemate" # Gotify config # Required for receiving push notifications when major events occur. GOTIFY_BASE_URL="" GOTIFY_APP_TOKEN="" # CourseCouponz config COURSECOUPONZ_RETRIES=3 COURSECOUPONZ_THREADS=2 COURSECOUPONZ_TIMEOUT=30 # Course Treat config COURSETREAT_RETRIES=3 COURSETREAT_THREADS=2 COURSETREAT_TIMEOUT=30 # Easy Learning config EASYLEARN_RETRIES=3 EASYLEARN_THREADS=10 EASYLEARN_TIMEOUT=30 # Freewebcart config FREEWEBCART_RETRIES=3 FREEWEBCART_THREADS=2 FREEWEBCART_TIMEOUT=30 # IDownloadCoupon config IDOWNLOADCOUPON_RETRIES=3 IDOWNLOADCOUPON_THREADS=25 IDOWNLOADCOUPON_TIMEOUT=30 # InventHigh config INVENTHIGH_RETRIES=3 INVENTHIGH_THREADS=2 INVENTHIGH_TIMEOUT=30 # Line51 config LINE51_RETRIES=3 LINE51_THREADS=2 LINE51_TIMEOUT=30 # Real Discount config REAL_DISCOUNT_RETRIES=3 REAL_DISCOUNT_THREADS=1 REAL_DISCOUNT_TIMEOUT=30 # WebHelperApp config WEBHELPERAPP_RETRIES=3 WEBHELPERAPP_THREADS=2 WEBHELPERAPP_TIMEOUT=30 # Udemy bot enrollment config UDEMY_EMAIL="" UDEMY_RETRIES=3 UDEMY_TIMEOUT=10
-
Create a virtual environment
# Windows python -m venv .venv # Linux python3 -m venv .venv
-
Activate the virtual environment
# Windows .\.venv\Scripts\activate # Linux source .venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Run the automation tool in headless mode to scrape intermediate links
# Windows python .\src\main.py --mode headless # Linux python3 src/main.py --mode headless
-
Run the tool in GUI mode to automate course enrollment
# Windows python .\src\main.py --mode gui # Linux python3 src/main.py --mode gui
Note the following:
- Command-line arguments override the corresponding environment variables.
- All command-line arguments are optional.
- The default mode is hybrid.
-
Implement environment variable parsing
-
Add requirements.txt
-
Implement refresh token authentication
-
Add functionality to generate JSON files containing middleman links grouped by hostname
-
Scrape intermediate links from the following middlemen:
-
Automate enrollment into Udemy courses
-
Implement caching mechanism for middleman and Udemy links
-
Transform codebase from standalone functions to class-based structure
-
Split driver into headless (for scraping) and non-headless (for enrollment)
-
Add logging across modules
-
Support Reddit accounts without 2FA enabled
-
Add argument parsing for different modes (headless, non-headless, hybrid)
-
Improve performance of Udemy bot by skipping owned and paid courses
-
Migrate from Selenium webdriver to undetected-chromedriver to reduce detection by Cloudflare anti-bot checks
-
Standardize & dedupe middleman links pre-crawl
-
Remove affiliate marketing parts from Udemy links before caching the URLs and automatic enrollment
-
Improve performance via per-domain concurrent spidering
-
Add command-line arguments for specifying
- mode (hybrid, headless, or gui)
- timeout for each spider and enrollment bot (in seconds)
- retries for each spider and enrollment bot
-
Fix issue where the enrollment bot failed to detect the first button by considering both values of
data-purpose: 'buy-this-course-button' and 'buy-now-button' -
Support Google Chrome for converting middleman links to Udemy links and automating course enrollment
-
Fix issue where Brave Browser runs out of VRAM in non-headless mode
-
Clean LinkSynergy links generated by IDownloadCoupon spider
-
Add push notifications using Gotify for informing the user about events occurring during each run
-
Delete the user data directory before the non-headless browser starts
-
Replace Undetected Chromedriver with Requests + Beautiful Soup for all middleman spiders except Freewebcart
-
Add threads to improve performance for the following middleman spiders:
- CourseCouponz
- Course Treat
- Easy Learning
- IDownloadCoupon
- Invent High
- WebHelperApp
-
Prevent GUI driver from starting when no new Udemy links are available
-
Fix enrollment issues in Udemy bot by checking string patterns in the current URL
-
Enhance logging reliability (UTF-8 support for Windows)
-
Fix intermittent enrollment failures by implementing robust detection and clicking logic for Udemy “Enroll now” buttons
-
Extract multiple middleman links from Reddit posts with markdown self-text
-
Support various subreddits including:
-
Improve Reddit scraping flexibility with per-subreddit limits
-
Automate Udemy login by following the steps below:
- Click on Log in button
- Automate email entry
- Click on purple Continue button
- Fetch verification code from Gmail
- Click on purple Log in button
-
Provide a docker image for headless mode to facilitate deployment
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Muhammad Azzazy - muhammadazzazy8@gmail.com
Project Link: https://github.com/muhammadazzazy/udemate