UnityPack icon indicating copy to clipboard operation
UnityPack copied to clipboard

AssertionError

Open welovekah opened this issue 8 years ago • 3 comments

Getting an AssertionError when attempting to run unityextract on an .assetbundle

py unityextract No_1.assetbundle

Traceback (most recent call last):
  File "unityextract", line 146, in <module>
    main()
  File "unityextract", line 143, in main
    exit(app.run())
  File "unityextract", line 53, in run
    bundle = unitypack.load(f)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\__init__.py", line 11, in load
    return env.load(file)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\environment.py", line 21, in load
    ret.load(file)
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\assetbundle.py", line 44, in load
    assert self.signature in (SIGNATURE_RAW, SIGNATURE_WEB), self.signature
AssertionError

Looking at the docs, it seems this utility only supports .Unity3D bundles. Are .assetbundle files not supported?

welovekah avatar Feb 20 '17 07:02 welovekah

Can you upload the file somewhere?

jleclanche avatar Feb 20 '17 12:02 jleclanche

I am running into the same thing. Here is the file I am trying to extract:

sharedassets11.zip

regner avatar Apr 20 '17 23:04 regner

I ran into the same thing was able to resolve it with Asset.from_file. For example:

import unitypack.asset

with open("example.assets", "rb") as fp:
    asset = unitypack.asset.Asset.from_file(fp)
    for id, object in asset.objects.items():
        print(object.type)

Note: It doesn't know how to handle MonoBehaviour objects, so I had to wrap the ObjectInfo.type getter call in a try block.

capntrips avatar Sep 05 '17 21:09 capntrips