├── requirements.txt ├── addons.py ├── README.md └── .gitignore /requirements.txt: -------------------------------------------------------------------------------- 1 | pyperclip 2 | mitmproxy 3 | -------------------------------------------------------------------------------- /addons.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env/ python3 2 | # -*- coding: utf-8 -*- 3 | """ 4 | :Author: yuangezhizao 5 | :Time: 2021/8/2 21:42 6 | :Site: https://www.yuangezhizao.cn 7 | :Copyright: © 2021 yuangezhizao 8 | """ 9 | import mitmproxy.http 10 | import pyperclip 11 | 12 | 13 | class GetCookies: 14 | def __init__(self): 15 | pass 16 | 17 | def response(self, flow: mitmproxy.http.HTTPFlow): 18 | if flow.request.url.find('https://maimai.wahlap.com/maimai-mobile/?t=') > -1: 19 | cookies = flow.response.headers.get('Set-Cookie') 20 | userId = cookies.split('userId=')[1].split(';')[0] 21 | pyperclip.copy(userId) 22 | print(f'userId: {userId} 已复制到剪切板') 23 | 24 | 25 | addons = [ 26 | GetCookies() 27 | ] 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # maimai_DX_CN_saver 2 | 3 | 舞萌数据存储 4 | 5 | ### 简介 6 | 7 | 懒得每次开`Charles`抓包复制`userId`,用`mitmproxy`复制到剪切板他不香嘛? 8 | 9 | ### 安装[mitmproxy](https://github.com/mitmproxy/mitmproxy) 10 | 11 | 参照:https://docs.mitmproxy.org/stable/overview-installation 12 | 13 | ### 配置证书 14 | 15 | 参照:https://docs.mitmproxy.org/stable/overview-getting-started/#configure-your-browser-or-device 16 | 17 | ### 使用 18 | 19 | ``` bash 20 | mitmdump -s addons.py 21 | ``` 22 | 23 | ### 页面适配(Ver.CH1.20-H) 24 | 25 | - [x] 主页(home) 26 | - [x] 游戏数据 27 | - [x] 游戏数据(playerData) 28 | - [x] 相册(playerData_album) 29 | - [x] 记录 30 | - [x] 游戏记录(record) 31 | - [x] 详细(record_playlogDetail) 32 | - [ ] 乐曲成绩(musicGenre) 33 | - [ ] 排行榜(ranking) 34 | 35 | ### 原始代码 36 | 37 | 1. https://github.com/yuangezhizao/maimai_DX_CN_probe/blob/main/src/maimai_DX_CN_probe/models/maimai.py 38 | 2. https://github.com/yuangezhizao/maimai_DX_CN_probe/blob/main/src/maimai_DX_CN_probe/plugins/wechat_saver.py 39 | 40 | ### 相关项目 41 | 42 | - [mainetcn](https://github.com/Astrian/mainetcn):`Cookie`中`userId`的解释非常详细,以至于自己的项目都懒得再写了 43 | - [maimaidx-prober](https://github.com/Diving-Fish/maimaidx-prober):都拿`Go`写了个抓包工具,实在是太硬核了 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | # 实例文件夹使用 git 管理,密匙均做 处理 66 | # instance/ 67 | .webassets-cache 68 | 69 | # Scrapy stuff: 70 | .scrapy 71 | 72 | # Sphinx documentation 73 | docs/_build/ 74 | 75 | # PyBuilder 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | .python-version 87 | 88 | # pipenv 89 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 90 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 91 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 92 | # install all needed dependencies. 93 | #Pipfile.lock 94 | 95 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 96 | __pypackages__/ 97 | 98 | # Celery stuff 99 | celerybeat-schedule 100 | celerybeat.pid 101 | 102 | # SageMath parsed files 103 | *.sage.py 104 | 105 | # Environments 106 | .env 107 | .venv 108 | env/ 109 | venv/ 110 | ENV/ 111 | env.bak/ 112 | venv.bak/ 113 | 114 | # Spyder project settings 115 | .spyderproject 116 | .spyproject 117 | 118 | # Rope project settings 119 | .ropeproject 120 | 121 | # mkdocs documentation 122 | /site 123 | 124 | # mypy 125 | .mypy_cache/ 126 | .dmypy.json 127 | dmypy.json 128 | 129 | # Pyre type checker 130 | .pyre/ 131 | 132 | # Pycharm 133 | .idea/* 134 | --------------------------------------------------------------------------------