I am having some problems extracting assets from a UnityWeb file.
It throws this exception on asset.objects.items():
Traceback (most recent call last):
File ".\example.py", line 8, in <module>
for id, object in asset.objects.items():
File "C:\Users\Rangedz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack\asset.py", line 83, in objects
self.load()
File "C:\Users\Rangedz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack\asset.py", line 99, in load
self.metadata_size = buf.read_uint()
File "C:\Users\Rangedz\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack\utils.py", line 105, in read_uint
return struct.unpack(self.endian + "I", self.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes
I tried opening it with Unity Assets Bundle Extractor and it seemed to work correctly, so I don't think there is anything wrong with the file.
import unitypack
with open("Event2d.unity3d", "rb") as f:
bundle = unitypack.load(f)
for asset in bundle.assets:
for id, object in asset.objects.items():
print(id,object.type)
UnityPack: 0.8.1
I am having some problems extracting assets from a UnityWeb file. It throws this exception on
asset.objects.items()
:I tried opening it with Unity Assets Bundle Extractor and it seemed to work correctly, so I don't think there is anything wrong with the file.
UnityWeb File: https://drive.google.com/file/d/19N-tjWW1cjIXKbSprvhWQSAyGcdkee-u/view?usp=sharing
Code used: