Skip to content

Commit

Permalink
Merge pull request #424 from aapatre/develop
Browse files Browse the repository at this point in the history
Release v4.1.3
  • Loading branch information
cullzie authored Mar 7, 2023
2 parents bb351eb + 211b239 commit 6ccbbad
Show file tree
Hide file tree
Showing 29 changed files with 576 additions and 267 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
tests
sample_settings.yaml
settings.yaml
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -50,7 +50,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -64,4 +64,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 setup.py udemy_enroller --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 setup.py udemy_enroller --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
- name: Run unittests
run: |
poetry run pytest
Expand All @@ -53,4 +53,4 @@ jobs:
UDEMY_PASSWORD: ${{ secrets.UDEMY_PASSWORD }}
CI_TEST: "True"
run: |
poetry run python udemy_enroller.py --browser=chrome --debug
poetry run python run_enroller.py --browser=chrome --debug
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ 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).

## [4.1.3] - 2023-03-07

### Added
- Fixing issues with enrollment and scraping
- Tidying up of the code structure

## [4.1.2] - 2022-06-03

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

[4.1.3]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v4.1.3
[4.1.2]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v4.1.2
[4.1.1]:
Expand Down
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.10-alpine

RUN apk add --no-cache build-base

RUN addgroup -S enroller && adduser -S enroller -G enroller
USER enroller
RUN mkdir -p ~/.udemy_enroller

WORKDIR /src

COPY . .

RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT [ "python", "run_enroller.py" ]
156 changes: 99 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[![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!
<br/>

Do you want to LEARN NEW STUFF for FREE? Don't worry, with the power of
web-scraping and automation, this script will find the necessary Udemy Coupons
Expand All @@ -14,70 +12,76 @@ web-scraping and automation, this script will find the necessary Udemy Coupons

**NOTE: THIS PROJECT WILL NOT WORK WITH NON ENGLISH UDEMY.**

<br/>

The code scrapes course links and coupons from:

- [tutorialbar.com](https://tutorialbar.com)
- [discudemy.com](https://discudemy.com)
- [coursevania.com](https://coursevania.com)
- [freebiesglobal.com](https://freebiesglobal.com) -> _New_
- [freebiesglobal.com](https://freebiesglobal.com)
- [idownloadcoupon.com](https://idownloadcoupon.com) -> _New_


In case of any bugs or issues, please open an issue in github.
In case of any bugs or issues, please open an issue in github. Also, don't forget to **Fork & Star the repository if you like it!**

Also, don't forget to **Fork & Star the repository if you like it!**
**We are also on _[GitLab](https://gitlab.com/the-automators/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE)_**
<br/><br/>

**_We are also on [GitLab](https://gitlab.com/the-automators/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE)_**

**_Video Proof:_**
## Video Proof:

[![Udemy Auto-Course-Enroller](https://img.youtube.com/vi/tdLsVoraMxw/0.jpg)](https://www.youtube.com/watch?v=tdLsVoraMxw "GET Udemy Courses for FREE with Python | 2 Minute Tuesday")

---

** **_Disclaimer & WARNINGS:_**
## Disclaimer & WARNINGS:

1. **Use** this ONLY for **Educational Purposes!** By using this code you agree
that **I'm not responsible for any kind of trouble** caused by the code. **THIS PROJECT IS NOT AFFILIATED WITH UDEMY.**
2. **Make sure web-scraping is legal in your region.**
3. This is **NOT a hacking script**, i.e., it can't enroll you for a specific
&emsp; 1. Use this ONLY for **Educational Purposes!** By using this code you agree that
**I'm not responsible for any kind of trouble** caused by the code. **THIS PROJECT IS NOT AFFILIATED WITH UDEMY.**
<br/>
&emsp; 2. **Make sure web-scraping is legal in your region.**
<br/>
&emsp; 3. This is **NOT a hacking script**, i.e., it can't enroll you for a specific
course! Instead it finds courses that provide coupon links to make the
transaction free and then LEGALLY enroll you to the course!

---

** Requirements:
## Requirements:

*** How to Install the Requirements?
### How to Install the Requirements?

**Required Python version:** [Python 3.8+](https://www.python.org/downloads/)
&emsp; __Required Python version:__ [Python 3.8+](https://www.python.org/downloads/)

**(Windows users only) Required Microsoft Visual C++ 14.0+ version:** [Microsoft Visual C++ 14.0+](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
&emsp; __(Windows users only) Required Microsoft Visual C++ 14.0+ version:__ [Microsoft Visual C++ 14.0+](https://visualstudio.microsoft.com/visual-cpp-build-tools/)

![alt text](https://docs.microsoft.com/answers/storage/attachments/34873-10262.png)

**You must have pip or poetry installed. Please look up how to install them in your OS.**
&emsp; __You must have pip or poetry installed. Please look up how to install them in your OS.__

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.

---

** Instructions
## Instructions

Props to Davidd Sargent for making a super simple video tutorial. If you prefer written instructions then continue reading further, else click on the image below for a quick video tutorial:

[![GET Udemy Courses for FREE with Python | 2 Minute Tuesday](https://i.ytimg.com/vi/6HLbqM-598k/hq720.jpg)](https://www.youtube.com/watch?v=6HLbqM-598k "pip installation of Automatic Udemy Course Enroller")

1 . Install from PyPI `pip install udemy-enroller`

- Run the script and the cli will guide you through the settings required
- Run the script and the cli will guide you through the settings required.
- If you decide to save the settings they will be stored in your home directory: <br>
**Windows**:
C:/Users/CurrentUserName/.udemy_enroller<br>
**Linux**:
/home/username/.udemy_enroller
**The values in settings.yaml should be in the same language as the site you are browsing on**
/home/username/.udemy_enroller
**The values in settings.yaml should be in the same language as the site you are browsing on.**

<br/>

2 . The script can be passed arguments:

Expand All @@ -87,26 +91,33 @@ Props to Davidd Sargent for making a super simple video tutorial. If you prefer
- `--coursevania`: Run the coursevania scraper only
- `--tutorialbar`: Run the tutorialbar scraper only
- `--freebiesglobal`: Run the freebiesglobal scraper only
- `--idownloadcoupon`: Run the idownloadcoupon 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
- `--delete-cookie`: Delete the cookie file if it exists
- `--debug`: Enable debug logging
- `--debug`: Enable debug logging

<br/>


3 . Run the script in terminal with your target runner:

- `udemy_enroller`
- `udemy_enroller --browser=chrome`
- `udemy_enroller --browser=chromium`
- `udemy_enroller --browser=chromium`

<br/>

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), [Coursevania](https://coursevania.com) and [FreebiesGlobal](https://freebiesglobal.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.

- Stop the script by pressing ctrl+c in terminal to stop the enrollment process.
- Stop the script by pressing `ctrl+c` in terminal to stop the enrollment process.

5 . _[New]_ At the end of process a detailed result is shown:
<br/>

5 . *[New]* At the end of process a detailed result is shown:

```
================== Run Statistics ==================
Expand All @@ -120,91 +131,122 @@ Total Enrolments: 1705
Savings: €2674.44
================== Run Statistics ==================
```


### Docker

Alternatively you can run the script in docker.

To build the image run:

```
docker build -t udemy_enroller .
```

After the build is finished you can run your container with one of the commands below (you can pass arguments as you would in the cli):

```
docker run -it udemy_enroller
```

After you entered your login credentials and settings detach from the interactive mode by pressing the `Ctrl-P` followed by `Ctrl-Q`.

You can also create a `settings.yaml` file from the `sample_settings.yaml` and mount to the container with the command:

```
docker run -v $(pwd)/settings.yaml:/home/enroller/.udemy_enroller/settings.yaml udemy_enroller
```



---

## FAQs

*** 1. Can I get a specific course for free with this script?
__1. Can I get a specific course for free with this script?__

Unfortunately no, but let me assure you that you may be lucky enough to get a
&emsp; Unfortunately no, but let me assure you that you may be lucky enough to get a
particular course for free when the instructor posts its coupon code in order
to promote it. Also, over time you would build a library of courses by running
the script often and have all the required courses in your collection. In fact,
I made this course after completing a
[Python automation course](https://www.udemy.com/course/automate/) and selenium,
[Python automation course](https://www.udemy.com/course/automate/) and [Selenium](https://www.selenium.dev/),
which of course I got for free! :)
<br/><br/>

__2. How does the bot work?__

*** 2. How does the bot work?

The bot retrieves coupon links from Tutorial Bar, DiscUdemy and Coursevania's lists to cut the prices and
&emsp; The bot retrieves coupon links from [Tutorial Bar](https://www.tutorialbar.com/all-courses/page/1), [DiscUdemy](https://www.discudemy.com/all) and [Coursevania](https://coursevania.com)'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.
to make those courses free. <br/><br/>


*** 3. How frequently should you run the script?
__3. How frequently should you run the script?__

Daily, at least once! I've painstakingly amassed over 4000
&emsp; Daily, at least once! I've painstakingly amassed over 4000
courses in the last four years! And out of those 4000, I've only paid for 4 of
these courses.

So, a mere **0.001%** of courses are **actually paid** in my collection!
Thankfully, you can get more than what I gathered in 4 years, in a matter of
weeks! 🙌🏻
weeks! 🙌🏻 <br/><br/>

*** 4. Why did I create this?

It used to be my daily habit to redeem courses and it was an extremely tedious
__4. Why did I create this?__

&emsp; It used to be my daily habit to redeem courses and it was an extremely tedious
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! :)
it will save your precious time too! :) <br/><br/>


*** 5. 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,
&emsp; 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.
retrieved in the Python console/shell, which may take a while. <br/><br/>


__6. Which is the best way to run the script?__

&emsp; It is recommended to run the script using your terminal and system python. <br/><br/>


*** 6. Which is the best way to run the script?
__7. Which branch to commit against?__

It is recommended to run the script using your terminal and system python.
&emsp; Pull request should be made on "_develop_" branch. <br/><br/>

*** 7. Which branch to commit against?

Pull request should be made on "develop" branch.
__8. What's the roadmap?__

*** 8. What's the roadmap?
&emsp; Take a look at our [Roadmap here](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/projects/1) and help us on what you want or talk to us about your proposed changes. <br/><br/>

Take a look at our
[Roadmap here](https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/projects/1)
and help us on what you want or talk to us about your proposed changes.

---

** Support & Maintenance Notice
## Support & Maintenance Notice

By using this repo/script, you agree that the authors and contributors are under no obligation to provide support for the script and can discontinue it's development, as and when necessary, without prior notice.

---

** Supporters
## Supporters

*** Jetbrains
### Jetbrains

[![JetBrains](https://i.imgur.com/h2R018M.jpg)](https://jetbrains.com/?from=udemy-free-course-enroller)

Thanks to [JetBrains](https://jetbrains.com/?from=udemy-free-course-enroller) for supporting us. They are the maker of world class IDE and developer tooling. If you think their product might help you, please support them.

*** GitBook
### GitBook

[![GitBook](https://i.imgur.com/OkuB14I.jpg)](https://gitbook.com)

Thanks to [GitBook](https://gitbook.com) for supporting us. GitBook is the best place to track personal notes and ideas for teams. If you think their product might help you, please support them.

*** GitLab
### GitLab

[![GitLab](https://i.imgur.com/aUWtSn4.png)](https://gitlab.com)

Expand Down
Loading

0 comments on commit 6ccbbad

Please sign in to comment.