Hamuko / cum

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

Error when downloading Boku no Hero Aacademia 191 from Mangadex #63

Closed ghost closed 5 years ago

ghost commented 5 years ago

1 through 190 downloads just fine, but when it gets to 191, it hits this error.

Traceback (most recent call last):
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\Comics\_Updater\python-3.6.6.amd64\Scripts\cum.exe\__main__.py", line 9, in <module>
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\cum\cum.py", line 15, in wrapper
    return f(*args, **kwargs)
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\cum\cum.py", line 154, in download
    chapter.get()
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\cum\scrapers\base.py", line 250, in get
    self.download()
  File "D:\Comics\_Updater\python-3.6.6.amd64\lib\site-packages\cum\scrapers\mangadex.py", line 134, in download
    chapter_hash = re.search(self.hash_re, r.text).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
ghost commented 5 years ago

Occurs with the post1 installation obtained from pip install git+https://github.com/Hamuko/cum as well

mxnemu commented 5 years ago

Mangadex recently got a new reader. I'm also getting the same error on different chapters. I'm looking into it right now.

This looks like the new place to get the info about pages: https://mangadex.org/api/chapter/420310?

Hamuko commented 5 years ago

Oh my, an actual API?

mxnemu commented 5 years ago

Yes, an actual json api! I rewrote the whole scraper, it's way less code and a lot faster than fetching 20 paginated html files. python3 -m cum.cum get https://mangadex.org/chapter/414899 passes on my machine now. I'll put up a pull request soon.