MakeYourLifeEasier / Wuxiaworld-2-eBook

This Python script will download chapters from novels availaible on wuxiaworld.com saves then into the .epub format
MIT License
92 stars 38 forks source link

Error downloading chapter that is split into two parts #36

Closed Kietyo closed 5 years ago

Kietyo commented 5 years ago

So I tried downloading Martial God Asura chapters 1559 to 2148 and got an error saying it couldn't locate chapter 1632:

PS C:\Users\kietm\git\Wuxiaworld-2-eBook> python.exe .\wuxiaworld2ebook.py URL: http://www.wuxiaworld.com/novel/martial-god-asura/mga-chapter-1632, HTTPError: 404 - Not Found Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\kietm\AppData\Local\Programs\Python\Python36\lib\tkinter__init.py", line 1705, in call return self.func(*args) File ".\wuxiaworld2ebook.py", line 85, in button_press getify.generate(file_list, raw_info[0], raw_info[3], raw_info[2], reset, str(e_chapter), cleanup=cleanup) File "C:\Users\kietm\git\Wuxiaworld-2-eBook\getify.py", line 172, in generate epub.write(html, "OEBPS/"+basename) File "C:\Users\kietm\AppData\Local\Programs\Python\Python36\lib\zipfile.py", line 1617, in write zinfo = ZipInfo.from_file(filename, arcname) File "C:\Users\kietm\AppData\Local\Programs\Python\Python36\lib\zipfile.py", line 507, in from_file st = os.stat(filename) FileNotFoundError: [WinError 2] The system cannot find the file specified: 'Martial God Asura\mga-chapter-1632.xhtml' Traceback (most recent call last): File ".\wuxiaworld2ebook.py", line 155, in main.mainloop() File "C:\Users\kietm\AppData\Local\Programs\Python\Python36\lib\tkinter\init__.py", line 1283, in mainloop self.tk.mainloop(n)

When I went to the site (https://www.wuxiaworld.com/novel/martial-god-asura). I noticed chapter 1632 was actually split into two parts, which might've been the reason why it couldn't be downloaded.

MichaelGuardian commented 5 years ago

Thanks for reporting the issue!

There was a problem with the chapter that returns 404 being added to the array with the successful downloaded files. While the hotfix does not downlaod chapter 1632, it won't break the script any longer.

The problem with the chapter not being downloaded is not fixable without changing the way the list of links is being fetched/generated. As I'm currently working on a new implementation of the script I won't fix it for now.