Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0.0 #68

Merged
merged 21 commits into from
Mar 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
87b5ad9
initial commit for nogizaka46 messages app support
proshunsuke Mar 2, 2022
af3f2cc
Create OpenApi specification for api.kh.glastonr.net
proshunsuke Mar 5, 2022
935187d
create docker-compose for mock server
proshunsuke Mar 5, 2022
9359d16
fix for mock server docker
proshunsuke Mar 5, 2022
760ace4
fix to be able to control whether the mock server returns values dyna…
proshunsuke Mar 5, 2022
37e01c1
fix README
proshunsuke Mar 5, 2022
f7d1228
Merge pull request #67 from proshunsuke/improve-development
proshunsuke Mar 5, 2022
a0d4e13
create OpenApi spcec for api.n46.glastonr.net
proshunsuke Mar 6, 2022
a09f379
fix docker-compose for created api.n46.glastonr.net OpenApi spec
proshunsuke Mar 6, 2022
38dc85a
fix api-kh-glastonr-net.yaml to match api-n46-glastonr-net.yaml
proshunsuke Mar 6, 2022
7c2e2d7
Merge pull request #69 from proshunsuke/create-open-api-spec-for-n64
proshunsuke Mar 6, 2022
34652fe
fix X-Talk-App-ID version for api.kh.glastonr.net
proshunsuke Mar 12, 2022
30e659a
add config of arguments for nogizaka
proshunsuke Mar 12, 2022
abccbe8
'group' should be able to accept multiple
proshunsuke Mar 12, 2022
5fb8320
add client for nogizaka
proshunsuke Mar 12, 2022
0dce333
support multiple 'group'. do not save if a refresh token is not speci…
proshunsuke Mar 12, 2022
1164941
enable nogizaka messages to be saved in accordance with existing system.
proshunsuke Mar 12, 2022
7c30d08
add past_messages to api.kh.glastonr.net OpenApi file
proshunsuke Mar 12, 2022
02b357f
fix docs for nogizaka46
proshunsuke Mar 12, 2022
a9a9ecd
save past_messages
proshunsuke Mar 12, 2022
8bb50da
Merge pull request #70 from proshunsuke/support-n64
proshunsuke Mar 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Packaging

# v3.0.0

## BREAKING CHANGES

* support "乃木坂46メッセージ"

# v2.0.4

https://github.com/proshunsuke/colmsg/pull/57
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "colmsg"
version = "2.0.4"
version = "3.0.0"
authors = ["proshunsuke <shunsuke0901@gmail.com>"]
categories = ["command-line-utilities"]
description="櫻坂46メッセージ」「日向坂46メッセージ」アプリのメッセージをPCに保存します."
description="Save the messages of '櫻坂46メッセージ', '日向坂46メッセージ' and '乃木坂46メッセージ' apps to the local."
homepage = "https://github.com/proshunsuke/colmsg"
license = "MIT"
readme = "README.md"
Expand Down
61 changes: 61 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
VERSION=`$(shell pwd)/target/release/colmsg -V | cut -b 8-`
CONTAINER_NAME=swagger-api-kh

ifeq ($(shell uname),Linux)
OPEN=xdg-open
else
OPEN=open
endif

release/x86_64-linux:
cargo build --release
Expand All @@ -11,3 +18,57 @@ release/x86_64-darwin:
release/x86_64-win:
cross build --release --target x86_64-pc-windows-gnu
@cd target/x86_64-pc-windows-gnu/release/ && zip colmsg-v${VERSION}-x86_64-pc-windows-gnu.zip colmsg.exe

server/kh:
docker-compose up swagger-api-kh

stop/server/kh:
docker-compose stop swagger-api-kh

restart/server/kh:
docker-compose restart swagger-api-kh

start/ui-editor/kh:
docker-compose up -d swagger-editor-kh swagger-ui-kh

stop/ui-editor/kh:
docker-compose stop swagger-editor-kh swagger-ui-kh

restart/ui-editor/kh:
docker-compose restart swagger-editor-kh swagger-ui-kh

open/editor/kh:
$(OPEN) http://localhost:8001/

open/ui/kh:
$(OPEN) http://localhost:8002/

server/n46:
docker-compose up swagger-api-n46

stop/server/n46:
docker-compose stop swagger-api-n46

restart/server/n46:
docker-compose restart swagger-api-n46

start/ui-editor/n46:
docker-compose up -d swagger-editor-n46 swagger-ui-n46

stop/ui-editor/n46:
docker-compose stop swagger-editor-n46 swagger-ui-n46

restart/ui-editor/n46:
docker-compose restart swagger-editor-n46 swagger-ui-n46

open/editor/n46:
$(OPEN) http://localhost:8004/

open/ui/n46:
$(OPEN) http://localhost:8005/

down:
docker-compose down --rmi all --volumes --remove-orphans

ssh:
docker exec -it $(CONTAINER_NAME) /bin/sh
77 changes: 41 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
# <img src="https://user-images.githubusercontent.com/3148511/99256532-e3433e00-2858-11eb-9dce-c5941574224e.png" width="32px" alt="櫻坂46メッセージのロゴ"><img src="https://user-images.githubusercontent.com/3148511/99256580-f6eea480-2858-11eb-848e-3351c3d8159b.png" width="32px" alt="日向坂46メッセージのロゴ"> colmsg
# <img src="https://user-images.githubusercontent.com/3148511/158018437-09822a33-8767-4e03-ba90-e0f69594c493.jpeg" width="32px" alt="櫻坂46メッセージのロゴ"><img src="https://user-images.githubusercontent.com/3148511/158018441-dd7cb9eb-bf31-4938-830d-1ef293a2afba.jpg" width="32px" alt="日向坂46メッセージのロゴ"><img src="https://user-images.githubusercontent.com/3148511/158018442-ae54e926-760d-4b47-b0a0-7255485e1f28.jpg" width="32px" alt="乃木坂46メッセージのロゴ"> colmsg

[「欅坂46/日向坂46 メッセージ」アプリを使用していた方へ](doc/changes_about_sakurazaka_and_hinatazaka_app.md)

「櫻坂46メッセージ」「日向坂46メッセージ」アプリのメッセージをPCに保存します。
「櫻坂46メッセージ」「日向坂46メッセージ」「乃木坂46メッセージ」アプリのメッセージをPCに保存します。

![sample.png](https://user-images.githubusercontent.com/3148511/85219015-fef60580-b3da-11ea-8b99-51666d27abe3.png)

## 概要

`colmsg` のインストール方法は[こちら](#インストール)を参照してください。

**まず初めに**「櫻坂46メッセージ」「日向坂46メッセージ」アプリそれぞれのrefresh_tokenを取得してください
**まず初めに**refresh_tokenを取得してください
取得方法は[こちら](doc/how_to_get_refresh_token.md)を参照してください。

取得出来たら以下を実行してください。
`<s_refresh_token>` , `<h_refresh_token>` に「櫻坂46メッセージ」「日向坂46メッセージ」それぞれで取得してきたrefresh_tokenを入れてください。
片方のアプリのみ購読している方は片方のみを指定してください
`<s_refresh_token>` , `<h_refresh_token>` , `<n_refresh_token>` に「櫻坂46メッセージ」「日向坂46メッセージ」「乃木坂46メッセージ」それぞれで取得してきたrefresh_tokenを入れてください。
指定するのは購読しているアプリのみで問題ありません
購読しているメンバー全員の全期間のメッセージが保存されます。

```shell script
$ colmsg --s_refresh_token <s_refresh_token> --h_refresh_token <h_refresh_token>
colmsg --s_refresh_token <s_refresh_token> --h_refresh_token <h_refresh_token> --n_refresh_token <n_refresh_token>
```

Windowsの場合は実行ファイル名を `colmsg.exe` に読み替えてください。
Expand All @@ -30,9 +28,10 @@ Windowsの場合は実行ファイル名を `colmsg.exe` に読み替えてく
* ✅ Android, iosアプリどちらにも対応しています
* ✅ Windows, macos, Linuxで実行できます
* ✅ 様々な保存方法が選べます
* ✅ 2020年10月14日のアプリアップデート後のバージョンに対応しています
* 「櫻坂46メッセージ」: バージョン1.0.00.65
* 「日向坂46メッセージ」: バージョン2.1.00.10020.68
* ✅ 以下のアプリのバージョンに対応しています
* 「櫻坂46メッセージ」: バージョン1.3.00.120
* 「日向坂46メッセージ」: バージョン2.4.00.120
* 「乃木坂46メッセージ」: バージョン1.0.02.121

## 使い方

Expand All @@ -47,47 +46,49 @@ configファイルについては[こちら](#configファイル)を参照して
特定のメンバーのメッセージを保存したい場合

```shell script
$ colmsg -n 菅井友香 -n 佐々木久美
colmsg -n 菅井友香 -n 佐々木久美
```

特定のグループのメッセージを保存したい場合

```shell script
$ colmsg -g sakurazaka
colmsg -g sakurazaka
```

特定の種類のメッセージを保存したい場合

```shell script
$ colmsg -k image -k video
colmsg -k picture -k video
```

特定の日時以降のメッセージを保存したい場合

```shell script
$ colmsg -F '2020/01/01 00:00:00'
colmsg -F '2020/01/01 00:00:00'
```

オプションは組み合わせて使用することが出来ます。より詳細な説明は以下を実行して確認してください。

```shell script
$ colmsg --help
colmsg --help
```

## 詳細な仕様

* 既にいくつかメッセージが保存されている場合にコマンドを実行すると、最後に保存したメッセージ以降のメッセージを取得して保存します
* 保存されるメッセージは次のディレクトリ構造で保存されます
* ```shell script
colmsg/
├── 日向坂46 一期生
│   └── 佐々木久美
│   ├── 1_0_20191231235959.txt
│   └── 2_1_20200101000000.jpg
└── 櫻坂46 一期生
└── 菅井友香
├── 3_2_20200101000001.mp4
└── 4_3_20200101000002.mp4
colmsg/
├── 日向坂46 一期生
│   └── 佐々木久美
│   └── 1_0_20191231235959.txt
├── 乃木坂46
│   └── 秋元真夏
│   └── 2_1_20200101000000.jpg
└── 櫻坂46 一期生
└── 菅井友香
├── 3_2_20200101000001.mp4
└── 4_3_20200101000002.mp4
```
* ファイル名の形式は `<シーケンス番号>_<種類>_<日付>.<拡張子>` となっています
* シーケンス番号はメッセージの時系列を表す番号になっています。若い数字程昔のメッセージです。ファイルブラウザで辞書順に並べると保存したメッセージが時系列通りに並びます
Expand All @@ -98,7 +99,7 @@ $ colmsg --help
* 3: ボイス
* 各環境毎のデフォルトの保存先は以下を実行することで確認することが出来ます
* ```shell script
$ colmsg --download-dir
colmsg --download-dir
```
* 既に保存済のメッセージは上書き保存されません

Expand All @@ -108,7 +109,7 @@ $ colmsg --help
デフォルトのパスは以下を実行することで確認することが出来ます。

```shell script
$ colmsg --config-dir
colmsg --config-dir
```
また、環境変数 `COLMSG_CONFIG_PATH` に設定ファイルの場所を明記することもできます。

Expand All @@ -129,6 +130,9 @@ export COLMSG_CONFIG_PATH="/path/to/colmsg.conf"
# h_refresh_tokenを指定
--h_refresh_token h_refresh_token

# n_refresh_tokenを指定
--n_refresh_token n_refresh_token

# メディアファイルだけ保存するように設定
-k image -k video -k voice
```
Expand All @@ -147,8 +151,8 @@ Windows用のビルド済実行ファイルをzipに圧縮して[リリースペ
Homebrewでインストールすることが出来ます。

```shell script
$ brew tap proshunsuke/colmsg
$ brew install colmsg
brew tap proshunsuke/colmsg
brew install colmsg
```

### Arch Linux
Expand All @@ -165,24 +169,25 @@ yay -S colmsg

## 開発

`colmsg` は外部APIを叩きます。開発時はAPIのモックサーバを建てると良いでしょう。そのためのSwagger Specを配置してあります。
TODO: Swagger Specを置く
`colmsg` は外部APIを叩きます。開発時はOpenApiを利用したモックサーバーを建てることが出来ます。

```shell
make server/kh
make server/n46
```

モックサーバのbase urlを環境変数 `S_BASE_URL` , `H_BASE_URL` で指定することが出来ます。以下のように指定することでモックサーバ宛てにAPIを叩きにいきます
環境変数 `S_BASE_URL` , `H_BASE_URL` , `N_BASE_URL` を指定することでモックサーバーへリクエストすることが出来ます

```shell script
$ S_BASE_URL=http://127.0.0.1:3100 cargo run -- --help
S_BASE_URL=http://localhost:8003 H_BASE_URL=http://localhost:8003 N_BASE_URL=http://localhost:8006 cargo run -- -d ~/Downloads/temp/ --help
```

## TODO

* [ ] deleteの実装
* [ ] docker環境の用意
* [ ] CIによる自動テスト
* [ ] examplesの用意
* [ ] メッセージ保存処理の並列化
* [ ] api clientのcrate化
* [ ] swagger specの配置

## ライセンス

Expand Down
Loading