pgsrip icon indicating copy to clipboard operation
pgsrip copied to clipboard

Error during rip: "ValueError: invalid literal for int() with base 16"

Open TimothyLoyer opened this issue 1 year ago • 4 comments

I getting this error for episodes I've ripped from a few particular series. In most cases I've had no problem, but these appear to be getting something unexpected - maybe there is an edge case which needs handled? I'll see whether I can use MKVToolNix to rip the subtitle tracks.

Thank you for a great tool!

Traceback (most recent call last):
  File ".venv/lib/python3.10/site-packages/pgsrip/ripper.py", line 128, in __init__
    max_height = max([item.height for item in self.pgs.items]) // 2
  File ".venv/lib/python3.10/site-packages/pgsrip/media.py", line 161, in items
    self._items = self.decode(data, self.media_path)
  File ".venv/lib/python3.10/site-packages/pgsrip/media.py", line 184, in decode
    return PgsSubtitleItem.create_items(media_path, display_sets)
  File ".venv/lib/python3.10/site-packages/pgsrip/media.py", line 45, in create_items
    candidates.append(PgsSubtitleItem(index, media_path, current_sets))
  File ".venv/lib/python3.10/site-packages/pgsrip/media.py", line 33, in __init__
    self.x_offset = min([ds.wds.x_offset for ds in display_sets] or [None])
  File ".venv/lib/python3.10/site-packages/pgsrip/media.py", line 33, in <listcomp>
    self.x_offset = min([ds.wds.x_offset for ds in display_sets] or [None])
  File ".venv/lib/python3.10/site-packages/pgsrip/pgs.py", line 278, in x_offset
    return from_hex(self.data[2:4])
  File ".venv/lib/python3.10/site-packages/pgsrip/utils.py", line 7, in from_hex
    return int(b.hex(), base=16)
ValueError: invalid literal for int() with base 16: ''

TimothyLoyer avatar Sep 16 '23 19:09 TimothyLoyer