Convert Mahjong Soul game logs to MJAI format using mjai-reviewer and tensoul
This tool downloads game logs from MajSoul Stats and converts them to the MJAI format.
- This tool collects data from third-party websites and games
- Only supports 4-player mahjong (三麻/3-player requires modifications to mjai-reviewer)
- Currently only compatible with CN server
- Uses mjai-reviewer (Apache-2.0 License)
If you find any missing attributions or licensing issues, please submit an ISSUE. Your feedback helps us maintain proper attribution and licensing compliance.
Before installation, ensure you have:
- Python 3.8+
- pip (Python package manager)
- Git
pip install -r requirements.txt
Required External Tool:
- Install mjai-reviewer
- Ensure it's added to your system PATH or properly referenced in your configuration
Check the web elements at MajSoul Stats
File Path: paipu_project/paipu_project/spiders/PaipuSpider.py
# Web element selector
"a.MuiTypography-root.MuiTypography-inherit.MuiLink-root.MuiLink-underlineHover.css-17xi075"
# For specific players
player_urls = [
# Add player URLs here
]
Example of web element:
<a href="https://game.maj-soul.com/1/?paipu=241114-189aa3d7--2e3e83a76230_a7832143000"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineHover css-17xi075"
title="查看牌谱"
target="_blank"
rel="noopener noreferrer">
0r0j50 [13000]
</a>
File Path: toumajsoul.py
username = "example@example.com"
password = "12345678"
Navigate to the paipu_project directory and run:
scrapy crawl paipu_spider
Note: This uses headless mode and multi-threading to download game IDs and save them to
tonpuulist.txt
Example output in tonpuulist.txt
:
241103-057ea444-a219-4202-930e-2d2472f4d6e600
- Move
tonpuulist.txt
to the root directory - Run
toumajsoul.py
Game logs will be saved in the tonpuulog
directory.
Example output: 241103-057ea444-a219-4202-930e-2d2472f4d6e600.json.gz
validate_logs.exe tonpuulog
This project incorporates code from mjai-reviewer under the Apache-2.0 license.
- mjai-reviewer - Game log analysis tool
- MajSoul Stats - Data source
Issues and pull requests are welcome. Please ensure proper attribution and licensing compliance when contributing.