diff --git a/udemy/compat.py b/udemy/compat.py index e64d9f9..8fb847c 100644 --- a/udemy/compat.py +++ b/udemy/compat.py @@ -52,12 +52,12 @@ SUBSCRIBED_COURSES = "https://www.udemy.com/api-2.0/users/me/subscribed-courses/?ordering=-last_accessed&fields[course]=id,url&page=1&page_size=12" HEADERS = { "Origin": "www.udemy.com", - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0", - "Referer": "https://www.udemy.com/join/login-popup/", + "User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0", + # "Referer": "https://www.udemy.com/join/login-popup/", "Accept": "*/*", - "Accept-Language": "en-US,en;q=0.5", - "Accept-Encoding": "gzip, deflate, br", - "Connection": "keep-alive", + # "Accept-Language": "en-US,en;q=0.5", + "Accept-Encoding": None, + # "Connection": "keep-alive", } diff --git a/udemy/extract.py b/udemy/extract.py index ae4de14..f4552f9 100644 --- a/udemy/extract.py +++ b/udemy/extract.py @@ -306,7 +306,7 @@ def _extract_course_info(self, url): sys.exit(0) def _extract_large_course_content(self, url): - url = url.replace("10000", "300") if url.endswith("10000") else url + url = url.replace("10000", "50") if url.endswith("10000") else url try: data = self._session._get(url).json() except conn_error as error: @@ -316,6 +316,7 @@ def _extract_large_course_content(self, url): else: _next = data.get("next") while _next: + logger.progress(msg="Downloading course information .. ") try: resp = self._session._get(_next).json() except conn_error as error: