Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎓 Udemy-Bot

Python License Status

A multi-provider Udemy course enroller that scrapes coupon sites, resolves Udemy coupon URLs, and automatically enrolls you in free courses using your Udemy cookies.

✨ Features

  • 🔌 Multi-Provider Support — 12 providers: ScrollCoupons, Korshub, CourseJoiner, CouponScorpion, UdemyXpert, CouponAmi, Courson, FreebiesGlobal, UdemyFreebies, RealDiscount, FreeWebCart, InfoGNU
  • 🚀 Automatic Enrollment — Resolves coupon URLs and attempts enrollment via Udemy checkout/GraphQL
  • 🔄 Smart Retries — Exponential backoff on transient failures and Udemy throttling (HTTP 429)
  • 🍪 Cookie-Based Auth — Supports cookies.json and cookies.txt export formats
  • 📊 Progress Tracking — Real-time progress bars, enrollment counts, and execution timing
  • 💾 CSV Logging — Saves enrolled courses to enrolled_courses.csv
  • 🐛 Debug Mode — Saves enrollment probe responses for troubleshooting

🛠️ Tech Stack

Tool Purpose
Python 3.10+ Runtime
curl_cffi HTTP client with TLS fingerprinting
BeautifulSoup4 HTML parsing
lxml Fast HTML/XML parser (optional)

📁 Project Structure

Udemy/
├── main.py                 # Entrypoint
├── cookie/
│   └── cookies.txt         # Udemy cookies (not in git)
├── providers/              # Provider implementations
│   ├── __init__.py
│   ├── base_provider.py
│   ├── scrollcoupons_provider.py
│   ├── korshub_provider.py
│   ├── coursejoiner_provider.py
│   ├── couponscorpion_provider.py
│   ├── udemyxpert_provider.py
│   ├── couponami_provider.py
│   ├── courson_provider.py
│   ├── freebiesglobal_provider.py
│   ├── udemyfreebies_provider.py
│   ├── realdiscount_provider.py
│   ├── freewebcart_provider.py
│   └── infognu_provider.py
├── helpers/
│   ├── udemy_helpers.py    # Udemy API, enrollment, cookie loading
│   └── session.py          # curl_cffi session factory with retries

🍪 Cookie Setup

The bot requires valid Udemy session cookies to enroll in courses.

Exporting Cookies from Firefox

  1. Install the Export Cookies TXT extension
  2. Log in to udemy.com
  3. Click the extension icon and export cookies to a .txt file
  4. Ensure only udemy.com cookies are included
  5. Save the file as cookie/cookies.txt in the project directory, or set the COOKIE_FILE environment variable to point to it

Cookie File Formats

Format Description
cookies.txt (Netscape) Recommended for Firefox export
cookies.json JSON object or array of cookie objects

⚡ Quick Start

1. Install Dependencies

pip install -r requirements.txt

2. Run

# Interactive provider selection
python main.py

# Specific provider
PROVIDER=scrollcoupons python main.py

# Multiple providers
PROVIDERS=scrollcoupons,korshub,coursejoiner,freewebcart,infognu python main.py

🔧 Environment Variables

Variable Default Description
PROVIDER scrollcoupons Single provider name
PROVIDERS — Comma-separated provider names
COOKIE_FILE cookie/cookies.txt Path to cookie file
CURL_IMPERSONATE firefox Browser impersonation (chrome, firefox)
SAVE_ENROLLMENT_DEBUG true Save enrollment probe responses

📊 Output

================================================================================
Provider: scrollcoupons (https://scrollcoupons.com/store/udemy/100-off/1)
================================================================================
Processing provider: scrollcoupons at page 1 in progress...
[001/015] Processing course: https://scrollcoupons.com/...
HTTP Status: 200
Course URL: https://www.udemy.com/course/...
Course ID: 1234567
Coupon Code: AUGUST2026
Coupon Status: Valid
Paid Course: True
Price Amount: $ 0.0
Price Currency: USD
Price Discount: 100%
Course Enrolled: True
Enrollment Date/Time: 2025-12-29 12:45:57+03:00
------------------------------------------------------------

Summary:
  Page: 1
  Total processed: 15
  Already enrolled: 3
  Newly enrolled: 7
  Not enrolled: 5
  Skipped because is_paid=False: 2
  Failed due to missing coupon code: 1
  Failed due to page fetch failure: 0
  Execution time: 124.53 seconds

⭐ Support

If you find this project helpful, please consider giving it a ⭐ star or forking it to contribute. Your support helps keep the project alive and visible to others.

⚠️ Disclaimer

This project is provided for educational purposes only. The author is not liable for any damages, account restrictions, or other consequences arising from the use or misuse of this tool. Use at your own risk.

📝 License

MIT

About

Udemy course auto-enrollment bot. Scans free-course providers and enrolls automatically using saved session cookies.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages