Skip to content

An automation tool that extracts middleman links from posts on various subreddits, converts them to Udemy links with coupons, and auto-enrolls into free courses.

License

Notifications You must be signed in to change notification settings

muhammadazzazy/udemate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

252 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuyMeACoffee LinkedIn Peerlist


Udemate

Udemy automation, supercharged
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

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.

Built With

Getting Started

Prerequisites

  • Python 3.11+

  • A Chromium-based browser (sorted from best-supported to least):

Reddit Bot Setup

Create a Reddit bot and get environment variables

  1. Visit Third-party app authorizations
  2. Click on create another app button at the bottom
  3. Set name to Udemate
  4. Select script
  5. Set description to an appropriate description (e.g. repo description)
  6. 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.

Tested Environment

Udemate was tested on Windows 11.

Installation

  1. Clone the repo

    git clone https://github.com/muhammadazzazy/udemate.git
  2. Navigate into the project directory

    cd udemate
  3. 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
  4. Create a virtual environment

    # Windows
    python -m venv .venv
    
    # Linux
    python3 -m venv .venv
  5. Activate the virtual environment

    # Windows
    .\.venv\Scripts\activate
    
    # Linux
    source .venv/bin/activate
  6. Install dependencies

    pip install -r requirements.txt
  7. 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
  8. 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:

  1. Command-line arguments override the corresponding environment variables.
  2. All command-line arguments are optional.
  3. The default mode is hybrid.

Roadmap

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

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Muhammad Azzazy - muhammadazzazy8@gmail.com

Project Link: https://github.com/muhammadazzazy/udemate

(back to top)

Acknowledgments

About

An automation tool that extracts middleman links from posts on various subreddits, converts them to Udemy links with coupons, and auto-enrolls into free courses.

Topics

Resources

License

Stars

Watchers

Forks

Languages