Skip to main content

Python package for extracting Houkai Gakuen 2 assets data

Project description

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 <module-name>). 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 --output-dir extracted --data-all path/to/data_all_dec.unity3d
Option Description Default Value
--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 <asset-names> --preset items --asset-file assets.txt --output-dir extracted --data-all path/to/data_all_dec.unity3d
Option Description Default Value
<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., auido.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 --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 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 --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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hg2_data_extractor-0.6.3.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hg2_data_extractor-0.6.3-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file hg2_data_extractor-0.6.3.tar.gz.

File metadata

  • Download URL: hg2_data_extractor-0.6.3.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.7

File hashes

Hashes for hg2_data_extractor-0.6.3.tar.gz
Algorithm Hash digest
SHA256 2046cd3d5f371879a5c2944eda1db0fa4240927ac12f384a4a500ec995c3b6e7
MD5 562688258cb7ca712c88706b9f91cb84
BLAKE2b-256 a7877efb192e6c417849074d5b5a8513f72224878f2d614aea63af9f834032a6

See more details on using hashes here.

File details

Details for the file hg2_data_extractor-0.6.3-py3-none-any.whl.

File metadata

File hashes

Hashes for hg2_data_extractor-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5e7eda971c835a24c65fc6f7db821ba6ae5627381ac20b5afffc9371ac360a70
MD5 2a3f281fc6a90d2990bfdc6eaa8524f6
BLAKE2b-256 31efa6379e16d34b35b0142b0327d3fef2573060e547124fa4929a2749575ed0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page