Skip to content

Commit

Permalink
bugfix/no-question-left (#14)
Browse files Browse the repository at this point in the history
Co-authored-by: Harshit Chaudhary <[email protected]>
  • Loading branch information
Harry-kp and harrrykp authored Sep 29, 2023
1 parent aaa58e2 commit f2f02a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chegg.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def fetch_question(self):
response = requests.request(
"POST", Chegg.URL, headers=self.headers, data=Chegg.FETCH_PAYLOAD, timeout=Chegg.TIMEOUT_FOR_REQUESTS)
if response.status_code == 401:
log("Unauthorised!! Cookie expired. PLease give a new cookie.")
log("Unauthorised!! Cookie expired. Please give a new cookie.")
exit()
res_data = json.loads(response.text)
log(f'HTTP Response {response.status_code}')
ques_obj = res_data['data']['nextQuestionAnsweringAssignment']['question']
ques_obj = res_data['data']['nextQuestionAnsweringAssignment']['question'] if res_data['data'] is not None else None
if ques_obj:
self.question = ques_obj
self.question_id = ques_obj['id']
Expand Down

0 comments on commit f2f02a6

Please sign in to comment.