Sydiepus / mangadex-py

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

Json error #8

Closed linus727 closed 3 years ago

linus727 commented 3 years ago

Hi i encountered another bug... it seems json related?

it happened after chapter 207 from this manga https://mangadex.org/title/d7037b2a-874a-4360-8a7b-07f2899152fd

Traceback (most recent call last):
  File "C:\Users\Linus\Desktop\Mangadex\mangadex-py-master\mangadex-py.py", line 4, in <module>
    main()
  File "C:\Users\Linus\Desktop\Mangadex\mangadex-py-master\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\Mangadex\mangadex-py-master\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\Mangadex\mangadex-py-master\mangadex_py\main.py", line 27, in main
    download.main(title, chap_list, desc, status, quality_mode, base_url, Manga_main_dir, thread)
  File "C:\Users\Linus\Desktop\Mangadex\mangadex-py-master\mangadex_py\download.py", line 60, in main
    chap_fetched = chapter_fetch(i[-1])
  File "C:\Users\Linus\Desktop\Mangadex\mangadex-py-master\mangadex_py\chapters.py", line 14, in chapter_fetch
    chapter_fetch = json.loads(chapter_fetch_rep.text)
  File "C:\Users\Linus\AppData\Local\Programs\Python\Python39-32\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Linus\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Linus\AppData\Local\Programs\Python\Python39-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
linus727 commented 3 years ago

Maybe it was due to some backend changes on the mangadex api around the same time. It’s working now again.

Sydiepus commented 3 years ago

How odd Could be a connection error caused by mangadex or something I'll work on the program to better handle connection errors based on status soo it won't break the program.