We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot process this type of quiz ("simple-quiz"):
(Maybe because of question length is zero.)
def _get_quiz_with_info(self, quiz_id): resp = {"_class": None, "_type": None, "contents": None} quiz_json = self._get_quiz(quiz_id) if len(quiz_json) == 0: return None is_only_one = len(quiz_json) == 1 and quiz_json[0]["_class"] == "assessment" is_coding_assignment = quiz_json[0]["assessment_type"] == "coding-problem" resp["_class"] = quiz_json[0]["_class"] if is_only_one and is_coding_assignment: assignment = quiz_json[0] prompt = assignment["prompt"] resp["_type"] = assignment["assessment_type"] resp["contents"] = { "instructions": self._get_elem_value_or_none(prompt, "instructions"), "tests": self._get_elem_value_or_none(prompt, "test_files"), "solutions": self._get_elem_value_or_none(prompt, "solution_files"), } resp["hasInstructions"] = False if resp["contents"]["instructions"] == "(None)" else True resp["hasTests"] = False if isinstance(resp["contents"]["tests"], str) else True resp["hasSolutions"] = False if isinstance(resp["contents"]["solutions"], str) else True else: # Normal quiz resp["_type"] = "normal-quiz" resp["contents"] = quiz_json return resp
i added this for temporarily:
if len(quiz_json) == 0: return None
because quiz_json vas "[]" (empty array)
and after, i added this:
def process_quiz(udemy: Udemy, lecture, chapter_dir): quiz = udemy._get_quiz_with_info(lecture.get("id")) if not quiz: logger.info(f" > Cannot processed quiz because it was empty: {lecture}") return if quiz["_type"] == "coding-problem": process_coding_assignment(quiz, lecture, chapter_dir) else: # Normal quiz process_normal_quiz(quiz, lecture, chapter_dir)
i logged the quiz object:
[12:38:40] [udemy-downloader] [process_quiz:1551] INFO: > Cannot processed quiz because it was empty: {'index': 4, 'lecture_index': 1, 'lecture_title': '004 Project Files', '_class': 'quiz', 'id': 4780872, 'data': {'_class': 'quiz', 'id': 4780872, 'title': 'Project Files', 'type': 'simple-quiz', 'object_index': 1}}
downloading the html is enough. because quiz is empty. im giving the logs with original source code bellow.
master/main
Linux/Unix
[01:33:07] [udemy-downloader] [pre_run:331] INFO: Output directory set to udemy-downloader/out_dir [01:33:07] [udemy-downloader] [__init__:359] WARNING: No bearer token was provided, attempting to use browser cookies. [01:33:07] [udemy-downloader] [main:1843] INFO: > Fetching course information, this may take a minute... [01:33:10] [udemy-downloader] [main:1846] INFO: > Course information retrieved! [01:33:10] [udemy-downloader] [main:1851] INFO: > Fetching course curriculum, this may take a minute... [01:33:11] [udemy-downloader] [_extract_course_curriculum:850] INFO: > Downloading course curriculum.. (Page 2/3) [01:33:11] [udemy-downloader] [main:1867] INFO: > Course curriculum retrieved! [01:33:11] [udemy-downloader] [main:1894] INFO: > Processing course data, this may take a minute. [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 2 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 3 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 4 of 212 [01:33:11] [udemy-downloader] [main:1974] INFO: Processing 5 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 7 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 8 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 9 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 10 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 11 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 12 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 13 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 14 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 15 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 16 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 17 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 18 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 19 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 20 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 22 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 23 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 24 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 25 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 26 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 28 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 29 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 30 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 31 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 32 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 33 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 34 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 35 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 36 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 38 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 39 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 40 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 42 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 43 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 44 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 45 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 47 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 48 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 49 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 50 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 51 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 52 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 53 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 54 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 56 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 57 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 58 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 59 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 60 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 61 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 62 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 64 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 65 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 67 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 68 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 69 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 70 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 71 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 72 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 73 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 75 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 76 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 77 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 79 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 80 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 81 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 82 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 83 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 84 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 85 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 86 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 87 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 88 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 89 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 91 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 92 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 94 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 95 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 96 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 97 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 98 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 100 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 101 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 102 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 103 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 105 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 106 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 107 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 109 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 110 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 111 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 112 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 113 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 114 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 115 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 116 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 117 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 118 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 120 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 121 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 122 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 123 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 124 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 125 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 126 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 127 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 128 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 129 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 130 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 132 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 133 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 134 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 135 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 136 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 137 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 138 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 139 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 140 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 142 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 143 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 144 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 145 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 146 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 147 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 149 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 150 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 152 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 153 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 154 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 155 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 156 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 157 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 158 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 159 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 160 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 161 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 162 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 163 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 164 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 165 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 166 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 167 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 168 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 169 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 170 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 171 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 172 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 173 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 174 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 175 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 176 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 177 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 178 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 179 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 180 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 181 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 182 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 183 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 184 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 185 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 186 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 187 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 188 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 189 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 190 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 191 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 192 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 193 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 194 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 195 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 196 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 197 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 198 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 199 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 200 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 202 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 203 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 204 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 205 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 206 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 207 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 208 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 209 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 210 of 212 [01:33:11] [udemy-downloader] [main:1938] INFO: Processing 212 of 212 [01:33:11] [udemy-downloader] [parse_new:1602] INFO: Chapter(s) (24) [01:33:11] [udemy-downloader] [parse_new:1603] INFO: Lecture(s) (188) ... [01:33:27] [udemy-downloader] [parse_new:1667] INFO: Processing 0 caption(s)... [01:33:27] [udemy-downloader] [parse_new:1675] INFO: > Processing 0 asset(s) for lecture... Traceback (most recent call last): File "/content/udemy-downloader/main.py", line 2018, in <module> main() File "/content/udemy-downloader/main.py", line 2011, in main parse_new(udemy, udemy_object) File "/content/udemy-downloader/main.py", line 1625, in parse_new process_quiz(udemy, lecture, chapter_dir) File "/content/udemy-downloader/main.py", line 1547, in process_quiz quiz = udemy._get_quiz_with_info(lecture.get("id")) File "/content/udemy-downloader/main.py", line 408, in _get_quiz_with_info is_coding_assignment = quiz_json[0]["assessment_type"] == "coding-problem" IndexError: list index out of range
temp_fix.zip
The text was updated successfully, but these errors were encountered:
Puyodead1
No branches or pull requests
What happened?
Cannot process this type of quiz ("simple-quiz"):
(Maybe because of question length is zero.)
i added this for temporarily:
because quiz_json vas "[]" (empty array)
and after, i added this:
i logged the quiz object:
Expected Result
downloading the html is enough. because quiz is empty.
im giving the logs with original source code bellow.
Branch
master/main
What operating systems are you seeing the problem on?
Linux/Unix
Relevant log output
Other information
temp_fix.zip
The text was updated successfully, but these errors were encountered: