fix: latin-1 codec error

untested if this fixes the issue or not, but it doesnt break anything either that i can tell
This commit is contained in:
Puyodead1 2022-03-25 21:21:18 -04:00 committed by GitHub
parent 3478095bb5
commit f824487d78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -610,7 +610,9 @@ class Udemy:
url = COURSE_SEARCH.format(portal_name=portal_name,
course_name=course_name)
try:
webpage = self.session._get(url).json()
webpage = self.session._get(url).content
webpage = webpage.decode("utf8", "ignore")
webpage = json.loads(webpage)
except conn_error as error:
logger.fatal(f"Udemy Says: Connection error, {error}")
time.sleep(0.8)