JohnDoee / autotorrent2

Cross-seed matching and torrent lifecycle tool
https://johndoee.github.io/autotorrent2/
MIT License
149 stars 12 forks source link

Skip files instead of stopping script #2

Closed Jerrk closed 2 years ago

Jerrk commented 2 years ago

Similar to my issues with the old autotorrent script https://github.com/JohnDoee/autotorrent/issues/51, if it runs into an error it will stop the script and i will have to find the offending .torrent and remove it manually.

i would suggest to just skip the file with the error or give a flag for that function.

ran the script a couple of times, all stalling on this file.

not sure what the problem is exactly

Traceback (most recent call last):
  File "/mnt/user/appdata/autotorrent2/bin/at2", line 8, in <module>
    sys.exit(cli())
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/__main__.py", line 371, in add
    torrent = parse_torrent(torrent_data, utf8_compat_mode=db.utf8_compat_mode)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/utils.py", line 476, in parse_torrent
    path = [
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/utils.py", line 477, in <listcomp>
    cleanup_torrent_path_segment(decode_str(p, try_fix=utf8_compat_mode))
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/utils.py", line 215, in cleanup_torrent_path_segment
    return path_segment.strip("/")
AttributeError: 'NoneType' object has no attribute 'strip'
JohnDoee commented 2 years ago

I already skip in a number of situations where torrents are broken and it is absolute the goal to find all the problems there might be.

If you find more ways to break it, then please do open a new issue.

JohnDoee commented 2 years ago

Try 1.0.1 and please come back with how else you can break the add :smile: