About
hg2-data-extractor is a Python package for downloading, decrypting, and extracting Houkai Gakuen 2 Unity text asset data.
Installation
From PyPi
pip install hg2-data-extractor
Commands Overview
The CLI offers several commands for processing data. Below is a quick summary:
| Command | Description |
|---|---|
lst |
Prints a list of all available asset names. |
download |
Downloads the data_all.unity3d file from a server. |
decrypt |
Decrypts the data_all.unity3d file into a ready-to-extract format. |
extract |
Extracts specific assets or a preset of assets into .tsv files. |
resources |
Downloads resource files from a server (e.g., auido.pck, video.mp4). |
Usage
The CLI is invoked through a main entry point (e.g., hg2-data-extractor or python -m hg2-data-extractor). Below are detailed examples for each command.
1. List Available Assets
Prints a list of all assets from the decrypted data_all.unity3d file.
hg2-data-extractor lst <version> --output-dir extracted --data-all path/to/data_all_dec.unity3d
| Option | Description | Default Value |
|---|---|---|
<version> |
The version of the game (e.g., 11.1 or 9_8). |
Required |
--output-dir, -o |
Directory to save the output file. | extracted |
--data-all, -d |
Path to the decrypted data_all file. |
data_all/data_all_dec.unity3d |
2. Download Data
Downloads the data_all.unity3d file from the specified server.
hg2-data-extractor download <server> <version> --decrypt --output-dir extracted
| Option | Description | Default Value |
|---|---|---|
<server> |
The server to download from (CN, JP). |
Required |
<version> |
The version of the game (e.g., 11.1 or 9_8). |
Required |
--decrypt |
Decrypts the downloaded file. | False |
--output-dir, -o |
Directory to save the downloaded file. | extracted |
3. Decrypt Data
Decrypts an encrypted data_all.unity3d file.
hg2-data-extractor decrypt <input> --output-dir data_all
| Option | Description | Default Value |
|---|---|---|
<input> |
Path to the file to decrypt. | data_all/data_all.unity3d |
--output-dir, -o |
Directory to save the decrypted file. | data_all |
4. Extract Assets
Extracts specific assets or a preset of assets into .tsv files.
hg2-data-extractor extract <version> <asset-names> --preset items --asset-file assets.txt --output-dir extracted --data-all path/to/data_all_dec.unity3d
| Option | Description | Default Value |
|---|---|---|
<version> |
The version of the game (e.g., 11.1 or 9_8). |
Required |
<asset-names> |
Names of assets to extract. | None |
--preset, -p |
Preset of assets to extract (items, story). |
None |
--asset-file, -f |
Path to a file with line-separated asset names. | None |
--output-dir, -o |
Directory to save the extracted files. | extracted |
--data-all, -d |
Path to the decrypted data_all file. |
data_all/data_all_dec.unity3d |
5. Download Resources
Downloads resource files from a server (e.g., audio.pck, video.mp4).
hg2-data-extractor resources <server> <version> --overwrite --output-dir resources
| Option | Description | Default Value |
|---|---|---|
<server> |
The server to download from (CN, JP). |
Required |
<version> |
The version of the game (e.g., 11.1 or 9_8). |
Required |
--overwrite |
Overwrites existing files. | False |
--output-dir, -o |
Directory to save the downloaded file. | resources |
Examples
1. Download, Decrypt, and Extract Preset
Download data from the JP server for version 11.1, decrypt it, and extract items:
hg2-data-extractor download JP 11.1 --decrypt --output-dir extracted
hg2-data-extractor extract 11.1 --preset items --data-all extracted/data_all_dec.unity3d --output-dir extracted
2. Extract Specific Assets
Extract specific assets by name:
hg2-data-extractor extract 11.1 WeaponDataV3 PassiveSkillDataV3 --data-all data_all/data_all_dec.unity3d --output-dir assets
3. Use a File for Asset Names
Extract assets listed in a file:
hg2-data-extractor extract 11.1 --asset-file assets.txt --data-all data_all/data_all_dec.unity3d --output-dir assets
Credits
This project is a modified version of the hg2-downloader project by BLUEALiCE
Metadata
Release files for hg2-data-extractor 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hg2_data_extractor-0.7.0.tar.gz | 62.2 kB | Without provenance | Details for hg2_data_extractor-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hg2_data_extractor-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for hg2_data_extractor-0.7.0-py3-none-any.whl |
Total release size: 85.3 kB
Release files / hg2_data_extractor-0.7.0.tar.gz
| Download URL | hg2_data_extractor-0.7.0.tar.gz |
|---|---|
| Size | 62.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
940842ca911a0ce947fd80c21e7b2a8c736ea317a1e7a9144cf21e648bce1f35
|
|
BLAKE2b-256 checksum How to use checksums |
e61e5364a3449b7ee2dc111343f2734a35537f373e49d24f336d2f15ffe4a74a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Release files / hg2_data_extractor-0.7.0-py3-none-any.whl
| Download URL | hg2_data_extractor-0.7.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fdb1a21d86317afd44a44b37003c08926cb521e081912e5c93efc3c27239c9e
|
|
BLAKE2b-256 checksum How to use checksums |
5825bed1571b1061f44f8365df1adad12de74ae29f0f5f2bfd36b9914d369292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.11
|
Security for hg2-data-extractor 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.