Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
fixed #562, issue with extracting large course contents.. should use …
Browse files Browse the repository at this point in the history
…--skip-hls to fetch things faster..
  • Loading branch information
r0oth3x49 committed Oct 11, 2020
1 parent 4187132 commit 4266e2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions udemy/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand Down
3 changes: 2 additions & 1 deletion udemy/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 4266e2e

Please sign in to comment.