{"id":24102776,"url":"https://github.com/thpatch-zh/thcrap_patch_mirror","last_synced_at":"2026-06-08T01:31:40.019Z","repository":{"id":258159698,"uuid":"873488186","full_name":"thpatch-zh/thcrap_patch_mirror","owner":"thpatch-zh","description":"A tool used to setting up mirror site for Touhou Patch Center file service","archived":false,"fork":false,"pushed_at":"2024-11-19T08:34:51.000Z","size":439,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T01:03:24.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thpatch-zh.png","metadata":{"files":{"readme":"README.md","changelog":"history.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-16T08:56:16.000Z","updated_at":"2025-08-20T03:44:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"8bbae688-436d-42ba-b90a-4b9c3a7d78a7","html_url":"https://github.com/thpatch-zh/thcrap_patch_mirror","commit_stats":null,"previous_names":["retrocyber/thcrap_patch_mirror","thpatch-zh/thcrap_patch_mirror"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thpatch-zh/thcrap_patch_mirror","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thpatch-zh%2Fthcrap_patch_mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thpatch-zh%2Fthcrap_patch_mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thpatch-zh%2Fthcrap_patch_mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thpatch-zh%2Fthcrap_patch_mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thpatch-zh","download_url":"https://codeload.github.com/thpatch-zh/thcrap_patch_mirror/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thpatch-zh%2Fthcrap_patch_mirror/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34044919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-10T18:36:54.212Z","updated_at":"2026-06-08T01:31:39.999Z","avatar_url":"https://github.com/thpatch-zh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# THcrap Mirror Script\n\n![Repo Size](https://img.shields.io/github/repo-size/RetroCyber/thcrap_patch_mirror.svg?label=RepoSize\u0026style=flat-square)\n[![touhou patch center](https://img.shields.io/badge/Require-thcrap-yellow.svg?style=flat-square)](http://thpatch.net)\n[![GitHub issues](https://img.shields.io/github/issues/RetroCyber/thcrap_patch_mirror.svg?label=Issues\u0026style=flat-square)](https://github.com/RetroCyber/thcrap_patch_mirror/issues)\n\n[Touhou Patch Center](https://www.thpatch.net/wiki/Touhou_Patch_Center:Main_page)\n\n[thcrap食用方法](https://thpatch.rcopky.top/attention/readme.html)\n\n[Touhou Patch Center中文站](https://thpatch.rcopky.top/)\n\n## Language Select / 选择语言\n\n- [English](#Description)\n- [简体中文](README_CN.md)\n---\n\n## Description\n\nThe scripts in this repository are used to facilitate users to build their own [mirror servers](https://www.thpatch.net/wiki/Touhou_Patch_Center:Servers). The main function is to add patches and perform periodic updates on them.\n\n## Repository file list\n\nThis repository contains:\n\n- `add_patch.py`: Used to add new patches to the mirror server.\n\n- `mirror_repo.py`: Used to update the patch files on the mirror server, with `repo` as the update unit.\n\n- `requirements.txt`: Dependency lib required by the scripts.\n\n- `.github/workflows/release.yml`: used to automate binary release scripts.\n\n- `generate_release_note.py`: used to generate the release note that accompanies the binary release scripts.\n\n- `history.md`: Update history of the scripts.\n\n## Usage\n\n### `add_patch.py`\n\n#### binary version\n\nThe binary version can be run directly:\n\n- **Windows**\n```bash\n$ add_patch.exe\n```\n\n- **Linux\u0026MacOS**\n```bash\n$ ./add_patch\n```\n\n#### Run `python` script\n\n- To run the script directly, enter the following command:\n\n```bash\n# Clone repository\n$ git clone https://github.com/RetroCyber/thcrap_patch_mirror.git\n$ cd thcrap_patch_mirror\n# Install dependency libraries\n$ pip install -r requirements.txt\n# Run script\n$ python3 add_patch.py\n```\n\n- If running, please follow the prompts to complete the user configuration first:\n\n\u003cimg src=\"doc/src/1.png\" div align=center\u003e\n\n\u003cp align=center\u003eConfiguration Description\u003c/p\u003e\n\n- Once the configuration is generated, input the URL of the `repo` you want to add, or the URL of the `patch`:\n\n\u003cimg src=\"doc/src/3.png\" div align=center\u003e\n\n\u003cp align=center\u003eInput URL\u003c/p\u003e\n\n- If the URL passes the script's detection, the next step is to select the patch to be added:\n\n\u003cimg src=\"doc/src/4.png\" div align=center\u003e\n\n\u003cp align=center\u003eSelect The Patch\u003c/p\u003e\n\n- After selecting, press Enter and the script will start downloading the patch file:\n\n\u003cimg src=\"doc/src/5.png\" div align=center\u003e\n\n\u003cp align=center\u003eDownload Files\u003c/p\u003e\n\n- If you exit unexpectedly, just run the script again and it will resume downloading from the interrupted position.\n\n\u003cimg src=\"doc/src/6.png\" div align=center\u003e\n\n\u003cp align=center\u003eResume download\u003c/p\u003e\n\n- After the download is complete, the script will automatically exit. If an unexpected exit occurs during the process, the script will ask whether to continue adding. Select \"Y\" to continue adding.\n\n\u003cimg src=\"doc/src/7.png\" div align=center\u003e\n\n\u003cp align=center\u003eFinish Downloading\u003c/p\u003e\n\n\u003e [!TIP]\n\u003e If the URL you enter is a `repo` address, please note that the URL needs to contain the `repo.js` file. The `patch` needs to contain the `patch.js` file.\n\u003e\n\u003e When the URL you input is a `patch`, you do not need to select any option, and the script will automatically start the download task.\n\n### `mirror_repo.py`\n\n#### Add periodic execution instructions\n\n- Enter the following command to enter the scheduled task editing interface:\n\n```bash\n# Open the scheduled task editing interface\n$ crontab -e\n```\n\n- The vim editor will open and the interface will be as follows:\n\n```bash\n# Edit this file to introduce tasks to be run by cron.\n#\n# Each task to run has to be defined through a single line\n# indicating with different fields when the task will be run\n# and what command to run for the task\n#\n# To define the time you can provide concrete values for\n# minute (m), hour (h), day of month (dom), month (mon),\n# and day of week (dow) or use '*' in these fields (for 'any').\n#\n# Notice that tasks will be started based on the cron's system\n# daemon's notion of time and timezones.\n#\n# Output of the crontab jobs (including errors) is sent through\n# email to the user the crontab file belongs to (unless redirected).\n#\n# For example, you can run a backup of all your user accounts\n# at 5 a.m every week with:\n# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/\n#\n# For more information see the manual pages of crontab(5) and cron(8)\n#\n# m h  dom mon dow   command\n~                         \n~                        \n~                         \n~                      \n~                         \n~                                              \n                                  23,28         All\n```\n\n- After entering the scheduled task editing interface, press the `I` key to switch to the **INSERT** mode to insert commands.\n\n```bash\n# Edit this file to introduce tasks to be run by cron.\n#\n# Each task to run has to be defined through a single line\n# indicating with different fields when the task will be run\n# and what command to run for the task\n#\n# To define the time you can provide concrete values for\n# minute (m), hour (h), day of month (dom), month (mon),\n# and day of week (dow) or use '*' in these fields (for 'any').\n#\n# Notice that tasks will be started based on the cron's system\n# daemon's notion of time and timezones.\n#\n# Output of the crontab jobs (including errors) is sent through\n# email to the user the crontab file belongs to (unless redirected).\n#\n# For example, you can run a backup of all your user accounts\n# at 5 a.m every week with:\n# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/\n#\n# For more information see the manual pages of crontab(5) and cron(8)\n#\n# m h  dom mon dow   command\n~                         \n~                        \n~                         \n~                      \n~                         \n~                                              \n-- INSERT --                                                                                          23,29         All\n```\n\n- Press **Enter** and then input the following command:\n\n```bash\n# This example runs the program every 10 seconds. You can modify the cycle as needed.\n*/10 * * * * python3 /*your_path*/mirror_repo.py # Replace the *your_path* part with the path to the script\n```\n\n- When finished, type `:wq` and press **Enter** to save and exit.\n\n## Special Thanks\n\n- brliron\n- The THPatch Team\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthpatch-zh%2Fthcrap_patch_mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthpatch-zh%2Fthcrap_patch_mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthpatch-zh%2Fthcrap_patch_mirror/lists"}