r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.85k stars 1.2k forks source link

Issue with chapters ending in '?' #29

Closed MrFilippo73 closed 6 years ago

MrFilippo73 commented 6 years ago

Hi r0oth3x49, congratulations for this work and thank you from Spain. I have some downloading problem with a particular Udemy course. In this course there is a chapter named: "¿Puedo ponerme en contacto con los profesores?" The error is the following:

[*] : Lecture : (006  Puedo ponerme en contacto con los profesores?)
Traceback (most recent call last):
  File "udemy-dl.py", line 893, in <module>
    main()
  File "udemy-dl.py", line 823, in main
    udemy.ExtractAndDownload(path=outto, quality=res, default=True)
  File "udemy-dl.py", line 423, in ExtractAndDownload
    with open(filename, 'wb') as f:
OSError: [Errno 22] Invalid argument: '006  Puedo ponerme en contacto con los profesores?.html'

I think the problem is with the '?' at the end. Because windows don't support this character for a file.

MrFilippo73 commented 6 years ago

Hi, I have the same type of problem with onother chapter's course named: "Introduccion y requisitos." (noted the '.' at the end)

Traceback (most recent call last):
  File "udemy-dl.py", line 893, in <module>
    main()
  File "udemy-dl.py", line 823, in main
    udemy.ExtractAndDownload(path=outto, quality=res, default=True)
  File "udemy-dl.py", line 391, in ExtractAndDownload
    out = self.Downloader(_url, lecture_name, chapter_path)
  File "udemy-dl.py", line 88, in Downloader
    out = course_dl.download(url, title, filepath=path, quiet=True, callback=self.Download)
  File "C:\Users\Dell\Desktop\udemy\udemy\_downloader.py", line 90, in download
    outfh = open(temp_filepath, fmode)
FileNotFoundError: [Errno 2] No such file or directory: 'c:/Udemy_Cursos/\\recursos-web-plugins-y-utilidades\\01 Empezar aqu \\001 Introducci n y requisitos_.mp4.part'
r0oth3x49 commented 6 years ago

@MrFilippo73 thanks for appreciation and report. i will add a fix for filename name ASAP.if you don't mind can you share the course link

MrFilippo73 commented 6 years ago

Hi r0ooth3x49, the course's links are the following: https://www.udemy.com/recursos-web-plugins-y-utilidades https://www.udemy.com/aprende-accesibilidad-web-paso-a-paso

r0oth3x49 commented 6 years ago

@MrFilippo73 thanks for using the utility i have added a fix for this.