techwizrd / MangaFox-Download-Script

A script that lets you download mangas from mangafox.com
77 stars 27 forks source link

Error puling down images #16

Closed Jzarecta closed 11 years ago

Jzarecta commented 11 years ago

Got the following error when trying to dowwnload chapter 91 of the Nana to Kaoru manga. $ python mfdl.py nana_to_kaoru 91 ... Getting image url from http://mangafox.me/manga/nana_to_kaoru/v11/c087/0.html Traceback (most recent call last): File "mfdl.py", line 154, in download_manga(sys.argv[1], sys.argv[2]) File "mfdl.py", line 132, in download_manga image_urls = get_chapter_image_urls(url_fragment) File "mfdl.py", line 70, in get_chapter_image_urls image_urls.append(images[0]['src']) IndexError: list index out of range

techwizrd commented 11 years ago

You needed to supply the command line arguments in the correct format. The manga name should be written as it is displayed on the website. In the case of your example, the manga name should be "Nana to Kaoru" instead of nana_to_kaoru. Your example should have been executed like so:

$ python mfdl.py "Nana to Kaoru" 91

However, I cannot blame you for making that mistake as the input format is not explicitly mentioned in the README.md file or any documentation and it should not fail with an IndexError either way. I just added support in commit 6c4ab10ebda6237134a9e2d2ca3c7a33edb3eff7 for manga names written in the "url format" (e.g., nana_to_kaoru) in an effort to be a little more user friendly. You can now use either nana_to_koaru or Nana to Koaru for the manga name.

Jzarecta commented 11 years ago

Actually the prolem was different, the code was old and it didnt refresh when I retrieve the update. So the IndexError happen when it detected a null value. It works now.