From c7aa950f47d5270e6fe3f1231c7ab095f29ab661 Mon Sep 17 00:00:00 2001 From: AL-Hareth Date: Mon, 11 Sep 2023 17:17:41 +0300 Subject: [PATCH] fix: fixed issue where requesting through s throws an error --- base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/base.py b/base.py index baf231aa..c1230988 100644 --- a/base.py +++ b/base.py @@ -365,7 +365,7 @@ def fetch_cookies(self): def get_course_id(self, url: str): # url="https://www.udemy.com/course/numpy-and-pandas-for-beginners?couponCode=EBEA9308D6497E4A8326" - try: + try: r = cloudscraper.CloudScraper().get(url) except requests.exceptions.ConnectionError: return "retry", url @@ -542,8 +542,9 @@ def manual_login(self, email: str, password: str): } ) # r = s.get("https://www.udemy.com/join/login-popup/?response_type=json") - s = cloudscraper.create_scraper(session=s) - r = s.post( + session = s + ss = cloudscraper.create_scraper(session) + r = ss.post( "https://www.udemy.com/join/login-popup/?response_type=json", data=data, allow_redirects=False,