This repository contains Python tools for scraping and managing resource metadata from the MapleStory Worlds API. These tools help collect GUIDs, tags, and image paths for various game assets.
The tools consist of two main scripts:
gen-ruids.py: Bulk scraper that discovers resources by categorypop-ruids.py: Targeted scraper that fetches metadata for specific GUIDs
Both scripts interact with the Nexon MapleStory Worlds API to collect resource information including:
- Resource GUIDs (Globally Unique Identifiers)
- Display names (tags)
- Image file paths
- Asset metadata
pip install httpx asyncioSet your API token as an environment variable:
export API_TOKEN="your_api_token_here"The API token should be obtained from the MapleStory Worlds platform and is required for authenticating with the Nexon API.
In the Network tab in Google Chrome (or other browser), you can obtain it from the X-Mverse-ifwt header.
You must be logged into the MapleStory Worlds API to obtain this header.
This script scrapes resources by category, discovering all available assets within specified categories.
It also builds populate.json for hidden resource categories that need GUID-specific population later.
- Category-based scraping: Processes different asset categories (sprites, sounds, character parts, etc.)
- Concurrent processing: Uses async/await with configurable concurrency for efficient API usage
- Resume capability: Tracks completed pages and can resume interrupted scraping sessions while always re-fetching the last completed page to catch tail-page additions
python gen-ruids.pyEdit the CATEGORIES dictionary in the script to enable/disable specific categories:
CATEGORIES = {
'sprite': '0', # Enable sprite category
# 'sound': '1,19', # Uncomment to enable sound category
# 'hair': '25,27', # Uncomment to enable hair category
# Add other categories as needed
}For each category (e.g., 'sprite'):
tags/sprite_tags.json: Maps display names to GUIDsguids/sprite_guids.json: Maps GUIDs to image pathsdone/sprite_done.json: Tracks completed pages for resume functionality
For populate-only categories (for example chatballoon, nametag, damageskin):
populate.json: Maps GUIDs to category names used bypop-ruids.pydone/populate_<category>_done.json: Tracks completed populate-manifest pages
This script fetches detailed metadata for specific GUIDs listed in populate.txt, discovered in populate.json, and auto-detected from category tag stores when a GUID is missing from the matching guids/*_guids.json file.
This is useful for the following categories, which are not listed on the MapleStory Worlds website:
- Name tag RUIDs
- Chat balloon RUIDs
- Tileset RUIDs
-
Run
gen-ruids.pywhen you want to refreshpopulate.jsonfor hidden categories. -
Optionally create or edit
populate.txtwith additional GUIDs to process:
# This is a comment - lines starting with # are ignored
guid-1234-5678-9abc-def0
guid-abcd-efgh-ijkl-mnop
# Another comment
guid-qrst-uvwx-yz12-3456
- Run the script:
python pop-ruids.pyTo limit processing to specific manifest categories:
python pop-ruids.py --category back
python pop-ruids.py --category back,object
python pop-ruids.py -c back -c objecttags/<category>_tags.json: Manifest-backed GUIDs are written to their category file, such astags/back_tags.jsonguids/<category>_guids.json: Manifest-backed GUIDs are written to their category file, such asguids/back_guids.jsontags/populate_tags.jsonandguids/populate_guids.json: Fallback outputs for GUIDs that come only frompopulate.txtand have no category inpopulate.json
When a GUID has category metadata in populate.json, pop-ruids.py preserves the API tag name when it already matches the category, such as portal-1.
pop-ruids.py processes the union of GUIDs from populate.txt, populate.json, and any tags/*_tags.json entries whose GUID is still missing from the matching guids/*_guids.json.
The effective priority order is populate.txt first, then missing GUIDs discovered from category tag stores, then the remaining populate.json GUIDs.
During preprocessing, pop-ruids.py logs category-store scanning and candidate filtering progress so long startup phases do not appear stalled.
When --category is provided, only GUIDs whose discovered category matches the requested values are processed, whether that category came from populate.json or an existing tag store.
Both scripts include configurable parameters:
COUNT = 100 # Items per API request page
CONCURRENCY = 1 # Number of concurrent requests
TIMEOUT_SEC = 15.0 # Request timeout in seconds
MAX_QPS = 2.0 # Shared API request cap across all scrapersAll outbound Nexon API GET requests in gen-ruids.py and pop-ruids.py, including page-count probes, are throttled through a shared 2 QPS limiter.
ruid/
├── maplestory_api.py # Shared API utilities module
├── gen-ruids.py # Category-based scraper
├── pop-ruids.py # GUID-specific scraper
├── populate.json # GUID->category manifest for populate flow
├── populate.txt # Input file for pop-ruids.py
├── tags/ # Tag-to-GUID mappings
│ ├── sprite_tags.json
│ ├── back_tags.json
│ └── populate_tags.json
├── guids/ # GUID-to-path mappings
│ ├── sprite_guids.json
│ ├── back_guids.json
│ └── populate_guids.json
└── done/ # Progress tracking
└── sprite_done.json
The scripts interact with the Nexon MapleStory Worlds API:
- Base URL:
https://mverse-api.nexon.com/resource/v1/search - Authentication: Bearer token via
X-Mverse-ifwtheader - Rate Limiting: Implemented via concurrent request limits
{
"sprite-example-001": "guid-1234-5678-9abc-def0",
"sprite-example-002": "guid-abcd-efgh-ijkl-mnop"
}{
"guid-1234-5678-9abc-def0": "character/face/001.img/default",
"guid-abcd-efgh-ijkl-mnop": "map/background/forest.img"
}The scripts include comprehensive error handling for:
- Network issues: Automatic retry and timeout handling
- API errors: Graceful handling of API response errors
- Interruption: Ctrl+C handling with progress saving
Feel free to raise issues in case any logic is incorrect.
This project is intended for research and development purposes.
HTTP timeout errors / JSON decode errors
- Usually indicates rate limiting - reduce
CONCURRENCYto lower network load - Verify API endpoint is accessible and the API_TOKEN is valid