Hamuko / cum

comic updater, mangafied
Apache License 2.0
170 stars 15 forks source link

fails to update or add new manga from mangadex #69

Closed ColorOfSilence closed 5 years ago

ColorOfSilence commented 5 years ago

when i run cum update it starts updating all the manga but then it crashes with the following json error:

==> Updating 69 series
Traceback (most recent call last):
  File "/usr/bin/cum", line 10, in <module>
    sys.exit(cli())
  File "/usr/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/cum/cum.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/cum/cum.py", line 432, in update
    series = future.result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
    return self.__get_result()
  File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.7/site-packages/cum/utility.py", line 71, in series_by_url
    return Series(url)
  File "/usr/lib/python3.7/site-packages/cum/scrapers/mangadex.py", line 24, in __init__
    self._get_page(self.url)
  File "/usr/lib/python3.7/site-packages/cum/scrapers/mangadex.py", line 49, in _get_page
    self.json = json.loads(r.text)
  File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.7/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)

it produces a similar error when I try adding a new series from mangadex

running cum version 0.9.1 "Morino Kirin-chan" from pip

ColorOfSilence commented 5 years ago

I tried adding a manga from one of the other sources (Doki Reader) and it added fine, so it might be an issue with mangadex itself

CounterPillow commented 5 years ago

Might be some of the DDoS mitigation they're currently doing

mxnemu commented 5 years ago

I think this should fix it: https://github.com/Hamuko/cum/pull/68

ColorOfSilence commented 5 years ago

@mxnemu thanks that seems to have done the trick! I checked and I was able to update, add new series, and download my manga. Hopefully that fix gets merged to master