2022-02-18 13:38:09 +00:00
|
|
|
# touhouwiki-mirror
|
|
|
|
|
|
|
|
Small collection of scripts to mirror Doujin CDs raw text and templates from [Touhou Wiki](https://en.touhouwiki.net/) for offline querying.
|
|
|
|
|
2022-02-20 13:47:05 +00:00
|
|
|
This repository also includes content fetched stored under [data/](data/). Files are tracked under Git LFS.
|
2022-02-18 13:38:09 +00:00
|
|
|
|
|
|
|
# Usage
|
2022-02-20 13:47:05 +00:00
|
|
|
You will need `git-lfs` package installed, and run at least one `$ git lfs install --skip-repo` command before to set up filter commands.
|
|
|
|
* `$ git clone https://git.gammaspectra.live/S.O.N.G/touhouwiki-mirror.git` to clone the repository.
|
2022-02-18 13:38:09 +00:00
|
|
|
* `$ ./all.sh` to do a full run updating where necessary
|
|
|
|
* `$ ./mirror.sh "<category name>" force` if fetching all pages of a category is necessary.
|
2022-02-19 02:12:06 +00:00
|
|
|
* `$ go run . -path data/` for running a server. Opens on port 8777.
|
|
|
|
|
|
|
|
# Content server features
|
2022-02-19 02:17:42 +00:00
|
|
|
Small Golang server that loads all albums in an index at startup and is used to serve files/results to queries.
|
|
|
|
|
|
|
|
* Access the entire content tree by path
|
|
|
|
* Access page by id ex. `/pages/54742.wiki`
|
|
|
|
* Access page by name ex. `/pages_by_name/RETRO_FUTURE_GIRLS.wiki`
|
2022-02-19 02:12:06 +00:00
|
|
|
* List files in a directory (ex. `/pages/` or `/pageindex/Arrangement_CDs/`)
|
2022-02-19 02:17:42 +00:00
|
|
|
* Query database by either any album title or album catalog number
|
2022-02-19 19:48:02 +00:00
|
|
|
* Album Title ex. `/search?type=album&query=マジコカタストロフィ`
|
|
|
|
* Album Catalog ex. `/search?type=album&query=STAL-1302`
|
2022-02-19 02:12:06 +00:00
|
|
|
* Values here are normalized so special characters or uppercase are changed. It deals with Unicode too.
|
2022-02-20 03:06:25 +00:00
|
|
|
* Additionally, `&type=loosealbum` exists to match loosely after normalization (will find partial matches).
|
2022-02-19 02:12:06 +00:00
|
|
|
* Bare CDDB emulator for `query` and `read` commands. Used to query by track count + length of album.
|
2022-02-20 03:06:25 +00:00
|
|
|
* query cmd ex. `/cddb?cmd=cddb+query+730dec08` (no need to provide TOC, but can be provided for more exact match)
|
2022-02-19 02:12:06 +00:00
|
|
|
* read cmd ex. `/cddb?cmd=cddb+read+Soundtrack54742+730dec08`
|
2022-02-20 15:20:11 +00:00
|
|
|
* Fetch parsed track Lyrics entries
|
|
|
|
* ex. `/lyrics/Clockup_Flowers`
|
2022-02-21 09:49:17 +00:00
|
|
|
* Fetch album entry by pageid
|
|
|
|
* ex. `/album/54742`
|
2022-02-18 13:38:09 +00:00
|
|
|
|
|
|
|
# License
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
Copyright (c) 2022 WeebDataHoarder
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
```
|
|
|
|
|
|
|
|
See the [README under data/](data/README.md) for more information about the Touhou Wiki respective content Copyrights and License
|