Skip to content

Commit

Permalink
temp fix: IndexError for some movie types
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyZanark committed Jun 23, 2023
1 parent 73516c8 commit 1f919b3
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions scripts/Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,21 @@ def extract(usm: pcc.USM, dirname: str = "") -> list[str]:
filenames.append(fname)

for i, (k, data) in enumerate(usm.output.items()):
if "SFV" in k:
with open(filenames[i+1], "wb") as out:
out.write(data)

elif "SFA" in k:
audio = pcc.ADX(data)
with open(filenames[i+1], "wb") as out:
out.write(audio.decode())

else:
raise NotImplementedError(f'Unknown type of data: {k}\nHeader: {data[:4]}')
try:
if "SFV" in k:
with open(filenames[i+1], "wb") as out:
out.write(data)

elif "SFA" in k:
audio = pcc.ADX(data)
with open(filenames[i+1], "wb") as out:
out.write(audio.decode())

else:
raise NotImplementedError(f'Unknown type of data: {k}\nHeader: {data[:4]}')

except IndexError:
continue

return filenames

Expand Down

0 comments on commit 1f919b3

Please sign in to comment.