Skip to content

Commit

Permalink
Merge pull request #256 from aapatre/develop
Browse files Browse the repository at this point in the history
Releasing v3.0.0
  • Loading branch information
cullzie authored Mar 4, 2021
2 parents 97fa0a8 + 6dbb031 commit 84ef428
Show file tree
Hide file tree
Showing 20 changed files with 614 additions and 634 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ jobs:
- name: Run unittests
run: |
poetry run pytest
- name: Make sure chrome crawler is working (Attempt to subscribe to 1 course)
- name: Make sure crawler is working (Attempt to subscribe to 1 course)
env:
UDEMY_EMAIL: ${{ secrets.UDEMY_EMAIL }}
UDEMY_PASSWORD: ${{ secrets.UDEMY_PASSWORD }}
CI_TEST: "True"
run: |
poetry run python udemy_enroller.py --browser=chrome
poetry run python udemy_enroller.py --debug
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.0.0] - 2021-03-03

### Added

- Enrollment now relies on REST requests
- New coupon source from coursevania

### Removed
- No longer supporting browser enrolment (Bot captcha was unsolvable)

## [2.0.0] - 2021-01-19

### Added
Expand Down Expand Up @@ -64,6 +75,8 @@ can continue as normal
project running locally. Suitable for users who are not looking forward to
contribute.

[3.0.0]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v3.0.0
[2.0.0]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v2.0.0
[1.0.0]:
Expand Down
73 changes: 15 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/it-works-why.svg)](https://forthebadge.com)

# ALPHA IS A PRE DEVELOPMENT BRANCH, DO NOT EXPECT USER FACING ISSUES TO BE ADDRESSED IN THIS BRANCH!

# Udemy Coupon Grabber & Course Enroller: Grab FREE Coupons!

Expand All @@ -15,6 +16,7 @@ web-scraping and automation, this script will find the necessary Udemy Coupons
The code scrapes course links and coupons from:
- [tutorialbar.com](https://tutorialbar.com)
- [discudemy.com](https://discudemy.com)
- [coursevania.com](https://coursevania.com)

In case of any bugs or issues, please open an issue in github.

Expand Down Expand Up @@ -52,20 +54,6 @@ Download a release of this project or clone the repository then navigate to the
folder where you placed the files on. Type `pip install -r requirements.txt` to
get all the requirements installed in one go. Similar instructions applies for poetry.

- **Webdrivers are now automatically installed! But here are some links in case
you are using the vanilla script or the Safari Browser:**

* Edge- https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
* Chrome- https://chromedriver.chromium.org/
* Firefox- https://github.com/mozilla/geckodriver/releases/
* Safari-
https://developer.apple.com/documentation/webkit/about_webdriver_for_safari/
* Opera- https://github.com/operasoftware/operachromiumdriver/releases
* Internet Explorer-
[Find it on your own accord](https://www.selenium.dev/downloads/)

**Note:** Make sure that the driver version matches your browser.

---

## Instructions
Expand All @@ -85,44 +73,20 @@ Props to Davidd Sargent for making a super simple video tutorial. If you prefer

**The values in settings.yaml should be in the same language as the site you are browsing on**

2 . Choose the appropriate command for your browser (from the list below):

- **Tested and works perfectly:**

- Chrome:
[udemy_enroller --browser=chrome](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)
- Chromium:
[udemy_enroller --browser=chromium](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)
- Edge:
[udemy_enroller --browser=edge](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)

- **Has issues when run on custom kernel but works fine on vanilla OS:**

- Firefox:
[udemy_enroller --browser=firefox (might require manual driver installation)](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)

- **Untested:**

- Opera:
[udemy_enroller --browser=opera](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)

- **Use at your own risk:**
- Internet Explorer:
[udemy_enroller --browser=internet_explorer](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/blob/master/udemy_enroller.py)

3 . The script can be passed arguments:
2 . The script can be passed arguments:
- `--help`: View full list of arguments available
- `--browser=<BROWSER_NAME>`: Run with a specific browser
- `--discudemy`: Run the discudemy scraper only
- `--coursevania`: Run the coursevania scraper only
- `--tutorialbar`: Run the tutorialbar scraper only
- `--max-pages=<NUMBER>`: Max number of pages to scrape from sites before exiting the script (default is 5)
- `--delete-settings`: Delete existing settings file
- `--debug`: Enable debug logging

4 . Run the chosen script in terminal like so:
- `udemy_enroller --browser=firefox`
3 . Run the script in terminal like so:
- `udemy_enroller`

5 . The bot starts scraping the course links from the first **All Courses** page
on [Tutorial Bar](https://www.tutorialbar.com/all-courses/page/1) and [DiscUdemy](https://www.discudemy.com/all) and starts
4 . The bot starts scraping the course links from the first **All Courses** page
on [Tutorial Bar](https://www.tutorialbar.com/all-courses/page/1), [DiscUdemy](https://www.discudemy.com/all) and [Coursevania](https://coursevania.com) and starts
enrolling you to Udemy courses. After it has enrolled you to courses from the
first page, it then moves to the next site page and the cycle continues.

Expand All @@ -144,8 +108,8 @@ which of course I got for free! :)

### 2. How does the bot work?

The bot retrieves coupon links from Tutorial Bar's and DiscUdemy list to cut the prices and
then uses Selenium's Browser automation features to login and enroll to the
The bot retrieves coupon links from Tutorial Bar, DiscUdemy and Coursevania's lists to cut the prices and
then uses REST requests to authenticate and enroll to the
courses. Think of it this way: Epic Games & other clients like Steam provide you
a handful of games each week, for free; Only in this case, we need a coupon code
to make those courses free.
Expand All @@ -167,30 +131,23 @@ task that took around 15 minutes, for 10 courses. And then I suddenly got the
idea to automate it, after I found the automation course mentioned above. I bet,
it will save your precious time too! :)

### 5. Udemy has detected that I'm using automation tools to browse the website! What should I do?

![](https://i.imgur.com/pwseilE.jpg) Relax! This happens when you run the script
several times in a short interval of time. Solve the captcha, hit enter in the terminal window you are running
the script from and allow the script to continue as normal.
Easy peasy lemon squeezy! 🍋🙃

### 6. The code compiles successfully but it's taking too long to work! IS there any way to fix that?
### 5. The code compiles successfully, but it's taking too long to work! IS there any way to fix that?

Since we are heavily dependent on a third-party site to retrieve coupons links,
there may be issues when the site is down. Needless to mention the connectivity
issues too. If everything is working fine, you can see the courses being
retrieved in the Python console/shell, which may take a while.

### 7. Which is the best way to run the script?
### 6. Which is the best way to run the script?

It is recommended to run the script using your terminal and system python.


### 8. Which branch to commit against?
### 7. Which branch to commit against?

Pull request should be made on "develop" branch.

### 9. What's the roadmap?
### 8. What's the roadmap?

Take a look at our
[Roadmap here](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/projects/1)
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[tool.poetry]
name = "automatic-udemy-course-enroller-get-paid-udemy-courses-for-free"
version = "2.0.0"
version = "3.0.0"
description = ""
authors = [""]

[tool.poetry.dependencies]
python = "^3.8"
selenium = "^3.141.0"
beautifulsoup4 = "^4.9.3"
"ruamel.yaml" = "^0.16.12"
webdriver-manager = "^3.2.2"
aiohttp = "^3.7.3"
cloudscraper = "^1.2.56"
requests = "^2.25.1"
aiohttp = {extras = ["speedups"], version = "^3.7.3"}

[tool.poetry.dev-dependencies]
black = "^20.8b1"
Expand Down
18 changes: 0 additions & 18 deletions requirements.py

This file was deleted.

6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiohttp
aiohttp[speedups]
beautifulsoup4
ruamel.yaml
selenium
webdriver-manager
requests
cloudscraper
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="udemy-enroller",
version="2.0.0",
version="3.0.0",
long_description=long_description,
long_description_content_type="text/markdown",
author="aapatre",
Expand All @@ -27,11 +27,11 @@
),
python_requires=">=3.8, <4",
install_requires=[
"aiohttp",
"aiohttp[speedups]",
"beautifulsoup4",
"ruamel.yaml",
"selenium",
"webdriver-manager",
"requests",
"cloudscraper",
],
setup_requires=["pytest-runner"],
extras_require={
Expand Down
120 changes: 0 additions & 120 deletions tests/core/test_driver_manager.py

This file was deleted.

Loading

0 comments on commit 84ef428

Please sign in to comment.