Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash - TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType' #15

Closed
TheFrenchGhosty opened this issue Apr 17, 2024 · 2 comments

Comments

@TheFrenchGhosty
Copy link

TheFrenchGhosty commented Apr 17, 2024

Consistently happen when I download:

Password protected:
https://beowulf.itch.io/rpg-boss-monsters-minions-huge-pack
https://world-land-trust.itch.io/thank-you-from-the-world-land-trust
https://jayskibean.itch.io/microhorrorarcade-trilogy-i

Access restricted
https://witpop.itch.io/sprite-pack-fantasy-male-mage

(or https://itch.io/my-purchases ).

The issues seems to be that the script can't handle any page that isn't publicly available.

A solution might just be to add proper handling... or just to ignore those (and maybe output the page URL to a file so that they can be downloaded manually)

This effectively crashes the itch-dl and requires re-starting it to download other files (I ended up just running it on loop)

Traceback (most recent call last):
  File "/home/<username>/.local/bin/itch-dl", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/itch_dl/cli.py", line 87, in run
    return drive_downloads(jobs, download_to, args.mirror_web, settings, keys, parallel=args.parallel)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/itch_dl/downloader.py", line 355, in drive_downloads
    results = thread_map(downloader.download, jobs, max_workers=parallel, **tqdm_args)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 69, in thread_map
    return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 51, in _executor_map
    return list(tqdm_class(ex.map(fn, *iterables, chunksize=chunksize), **kwargs))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/tqdm/std.py", line 1181, in __iter__
    for obj in iterable:
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/itch_dl/downloader.py", line 240, in download
    game_id = self.get_game_id(url, site)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/<username>/.local/share/pipx/venvs/itch-dl/lib/python3.11/site-packages/itch_dl/downloader.py", line 117, in get_game_id
    game_id = int(data_request.json().get("id"))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
@TheFrenchGhosty
Copy link
Author

Looks like it's the same issue as #14

@DragoonAethis
Copy link
Owner

Yup, same as #14, crash fixed in 0.4.1, see #16 for a tracker on downloading restricted items. Thanks for your report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants