Skip to content

Commit

Permalink
Merge pull request #383 from aapatre/develop
Browse files Browse the repository at this point in the history
V4.1.1 Release
  • Loading branch information
cullzie authored May 27, 2022
2 parents ba9f730 + 4475b33 commit 7554073
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 42 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,7 @@ test_tmp/

#ignore deepsource.toml

.deepsource.toml
.deepsource.toml

# ignore pypi config
.pypirc
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ 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.1] - 2022-05-27

### Added
- Resolved issue with REST based enrolment
- Generate enrolment report even on ctrl-c of run
- Tied external dependencies to known working versions

## [4.1.0] - 2022-05-20

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

[4.1.1]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v4.1.1
[4.1.0]:
https://github.com/aapatre/Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE/releases/tag/v4.1.0
[4.0.0]:
Expand Down
35 changes: 17 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
[tool.poetry]
name = "automatic-udemy-course-enroller-get-paid-udemy-courses-for-free"
version = "4.1.0"
version = "4.1.1"
description = ""
authors = [""]

[tool.poetry.dependencies]
python = "^3.8"
selenium = "^3.141.0"
beautifulsoup4 = "^4.9.3"
"ruamel.yaml" = "^0.16.12"
cloudscraper = "^1.2.56"
requests = "^2.25.1"
webdriver-manager = "^3.2.2"
aiohttp = {extras = ["speedups"], version = "^3.7.3"}
beautifulsoup4 = "^4.11.1"
"ruamel.yaml" = "^0.16.13"
cloudscraper = "^1.2.60"
requests = "^2.27.1"
webdriver-manager = "^3.7.0"
aiohttp = {extras = ["speedups"], version = "^3.8.1"}
price-parser = "^0.3.4"

[tool.poetry.dev-dependencies]
black = "^20.8b1"
isort = "^5.6.4"
pytest = "^6.1.2"
pytest-cov = "^2.10.1"
pytest-asyncio = "^0.14.0"
bumpver = "^2021.1113"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
black = "^22.3.0"
isort = "^5.10.1"
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
pytest-asyncio = "^0.18.3"
bumpver = "^2022.1116"

[tool.bumpver]
current_version = "4.1.0"
current_version = "4.1.1"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "Bump version {old_version} -> {new_version}"
commit = true
Expand All @@ -44,3 +40,6 @@ push = false
'version="{version}"',
]

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
16 changes: 8 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
aiohttp[speedups]
beautifulsoup4
ruamel.yaml
requests
cloudscraper
webdriver-manager
selenium
price-parser
aiohttp[speedups]==3.8.1
beautifulsoup4==4.11.1
ruamel.yaml==0.16.13
requests==2.27.1
cloudscraper==1.2.60
webdriver-manager==3.7.0
selenium==3.141.0
price-parser==0.3.4
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="udemy-enroller",
version="4.1.0",
version="4.1.1",
long_description=long_description,
long_description_content_type="text/markdown",
author="aapatre",
Expand All @@ -27,14 +27,14 @@
),
python_requires=">=3.8, <4",
install_requires=[
"aiohttp[speedups]",
"beautifulsoup4",
"ruamel.yaml",
"requests",
"cloudscraper",
"webdriver-manager",
"selenium",
"price-parser",
"aiohttp[speedups]==3.8.1",
"beautifulsoup4==4.11.1",
"ruamel.yaml==0.16.13",
"requests==2.27.1",
"cloudscraper==1.2.60",
"webdriver-manager==3.7.0",
"selenium==3.141.0",
"price-parser==0.3.4",
],
setup_requires=["pytest-runner"],
extras_require={
Expand Down
2 changes: 1 addition & 1 deletion udemy_enroller/driver_manager.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType
from webdriver_manager.firefox import GeckoDriverManager
from webdriver_manager.microsoft import EdgeChromiumDriverManager, IEDriverManager
from webdriver_manager.opera import OperaDriverManager
from webdriver_manager.utils import ChromeType

from udemy_enroller.logging import get_logger

Expand Down
1 change: 1 addition & 0 deletions udemy_enroller/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def _redeem_courses(settings: Settings, scrapers: ScraperManager) -> None:
)
time.sleep(sleep_time)
except KeyboardInterrupt:
udemy_actions.stats.table()
logger.error("Exiting the script")
return
except Exception as e:
Expand Down
9 changes: 4 additions & 5 deletions udemy_enroller/udemy_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(self, settings: Settings, cookie_file_name: str = ".cookie"):
self.settings = settings
self.user_has_preferences = self.settings.categories or self.settings.languages
self.session = requests.Session()
self.udemy_scraper = create_scraper()
self.udemy_scraper = create_scraper(ecdhCurve="secp384r1")
self._cookie_file = os.path.join(get_app_dir(), cookie_file_name)
self._enrolled_course_info = []
self._all_course_ids = []
Expand All @@ -129,11 +129,10 @@ def login(self, retry=False) -> None:
if cookie_details is None:
response = self.udemy_scraper.get(self.LOGIN_URL)
soup = BeautifulSoup(response.content, "html.parser")
csrf_token = soup.find("input", {"name": "csrfmiddlewaretoken"}).get(
"value"
)
csrf_element = soup.find("input", {"name": "csrfmiddlewaretoken"}) or {}
csrf_token = csrf_element.get("value")
if csrf_token is None:
raise Exception(f"Unable to get csrf_token")
raise Exception("Unable to get csrf_token")

# Prompt for email/password if we don't have them saved in settings
if self.settings.email is None:
Expand Down

0 comments on commit 7554073

Please sign in to comment.