neuronalism / edxdlr

edx Downloader 课程视频工具
GNU General Public License v3.0
18 stars 6 forks source link

[WinError 123] #2

Closed CevreMuhendisi closed 2 years ago

CevreMuhendisi commented 2 years ago

Processing 'https://courses.edx.org/xblock/block-*' [download] None => Downloaded***\02-1. Wastewater treatment plant overview\03-1.2. Wastewater characteristics\03-Quiz- Wastewater characteristics\00.html Traceback (most recent call last): File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 693, in main() File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 688, in main download_course(args, course_block, headers, file_formats) File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 640, in download_course mkdir_p(target_dir) File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\utils.py", line 133, in mkdir_p os.makedirs(path, mode) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs mkdir(name, mode) OSError: [WinError 123] Dosya adı, dizin adı veya birim etiketi sözdizimi hatalı: 'Downloaded\Urban Sewage Treatment\02-1. Wastewater treatment plant overview\04-1.3. What should be removed?'

i need help sir. im using python 3.10.4

CevreMuhendisi commented 2 years ago

Output directory: Downloaded Traceback (most recent call last): File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 693, in main() File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 688, in main download_course(args, course_block, headers, file_formats) File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\edxdlr.py", line 640, in download_course mkdir_p(target_dir) File "C:\Users\İbrahim\Desktop\Edx\edxdlr-master\utils.py", line 133, in mkdir_p os.makedirs(path, mode) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 215, in makedirs makedirs(head, exist_ok=exist_ok) File "C:\Users\İbrahim\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs mkdir(name, mode) OSError: [WinError 123] Dosya adı, dizin adı veya birim etiketi sözdizimi hatalı: '

neuronalism commented 2 years ago

@CevreMuhendisi oh I see. There's a question mark in the file name and windows cannot create such file. I may need some time fixing this. Can you provide the course ID or link so that I can test this?

CevreMuhendisi commented 2 years ago

course-v1:DelftX+CTB3365STx+3T2021

neuronalism commented 2 years ago

@CevreMuhendisi a quick fix for you: go to utils.py Line 159, insert a line that says: .replace('?','') therefore the original bracket shall goes to line 160.

I'll try for a few more scenarios before I make a new commit.

CevreMuhendisi commented 2 years ago

Thank you so much

neuronalism commented 2 years ago

I made a patch, tried your course and the code seemd to run okay. I should admit that human beings (lecturers) are so unpredictable on naming titles. sigh If there are more problems u can start a new issue

CevreMuhendisi commented 2 years ago

I made a patch, tried your course and the code seemd to run okay. I should admit that human beings (lecturers) are so unpredictable on naming titles. sigh If there are more problems u can start a new issue

I tried and it worked. Thank you very much, I will recommend to everyone