Sydiepus / mangadex-py

MangaDexv5 manga downloader.
MIT License
2 stars 1 forks source link

Error when no chapters are from the selected language #7

Closed linus727 closed 3 years ago

linus727 commented 3 years ago

For this Manga I have this error on startup. Maybe because there are no English chapters available, but it shouldn't trow an error like this, or?

getting uuid.
fetching manga info 'Title' 'description' 'status' based on your language setting.
No altTitles with that language found; using default title.
fetching chapters info 'available languages' 'available volumes if any' 'available chapters' 'total chapters (language independent)'.
-------------------------------------------
One Piece
-------------------------------------------
fetching 'chapter list by language' 'total chapters by language.'
found 151 out of 4468 for en
getting a server url to download the images from.
Traceback (most recent call last):
  File "C:\Users\linus\Desktop\Neuer Ordner\mangadex-py.py", line 4, in <module>
    main()
  File "C:\Users\linus\Desktop\Neuer Ordner\mangadex_py\util.py", line 16, in main
    file_main(args.File, langwithindex, args.quality_mode, args.destination, args.max_threads)
  File "C:\Users\linus\Desktop\Neuer Ordner\mangadex_py\file_main.py", line 11, in file_main
    main(url_name[0], langWithIndex, quality_mode, Manga_main_dir, thread)
  File "C:\Users\linus\Desktop\Neuer Ordner\mangadex_py\main.py", line 23, in main
    base_url = chapter.base_url_fetch(chap_list)
  File "C:\Users\linus\Desktop\Neuer Ordner\mangadex_py\chapters.py", line 18, in base_url_fetch
    base_url = requests.get(f"{api_url_home}{lang_chap_list[0][-1]}").json()["baseUrl"]
IndexError: list index out of range
Sydiepus commented 3 years ago

you're right there's no english chapters for this manga yet somehow you found 151 chapters. well it should throw an error like this because i don't break the program if no chapters were found.


fetching manga info 'Title' 'description' 'status' based on your language setting.
No altTitles with that language found; using default title.
fetching chapters info 'available languages' 'available volumes if any' 'available chapters' 'total chapters (language independent)'.fetching 'chapter list by language' 'total chapters by language.'
found 0 out of 4468 for en
getting a server url to download the images from.
[]
Traceback (most recent call last):
  File "C:\Users\sydie\.github\mangadex-py\mangadex-py.py", line 4, in <module>
    main()
  File "C:\Users\sydie\.github\mangadex-py\mangadex_py\util.py", line 14, in main
    real_main(args.url, langwithindex, args.quality_mode, args.destination, args.max_threads, args.name)
  File "C:\Users\sydie\.github\mangadex-py\mangadex_py\main.py", line 21, in main
    base_url = chapter.base_url_fetch(chap_list)
  File "C:\Users\sydie\.github\mangadex-py\mangadex_py\chapters.py", line 18, in base_url_fetch
    base_url = requests.get(f"{api_url_home}{lang_chap_list[0][-1]}").json()["baseUrl"]
IndexError: list index out of range   ```   
linus727 commented 3 years ago

In bulk download mode, this now aborts the script and is not switching to the next manga in line.

Sydiepus commented 3 years ago

should be fixed now.

linus727 commented 3 years ago

Works fine for me too. :)

Sydiepus commented 3 years ago

that's good to know.
i'm sorry for the inconvenience.
And thank you for reporting all the issues to make the project better.