JohnDoee / autotorrent

Matches torrents with files and gets them seeded
MIT License
269 stars 34 forks source link

IndexError: index out of range #39

Open adamwinn opened 4 years ago

adamwinn commented 4 years ago
Found 2280 torrent(s)
Traceback (most recent call last):
  File "cmd.py", line 317, in <module>
    commandline_handler()
  File "cmd.py", line 241, in commandline_handler
    result = at.handle_torrentfile(os.path.join(current_path, torrent_file), dry_run)
  File "/volume1/homes/adamwinn/scripts/autotorrent/at.py", line 419, in handle_torrentfile
    torrent = self.open_torrentfile(path)
  File "/volume1/homes/adamwinn/scripts/autotorrent/at.py", line 488, in open_torrentfile
    return bdecode(f.read())
  File "/volume1/homes/adamwinn/scripts/autotorrent/bencode.py", line 62, in bdecode
    r, l = decode_func[six.indexbytes(x, 0)](x, 0)
IndexError: index out of range
JohnDoee commented 4 years ago

That generally happens when the torrent is either broken or not an actual torrent. Can you verify the torrent is actually a torrent ?

adamwinn commented 4 years ago

That was the case. Should raise a proper error message tho.

adamwinn commented 4 years ago

15