Coder Social home page Coder Social logo

proshunsuke / colmsg Goto Github PK

View Code? Open in Web Editor NEW
124.0 8.0 13.0 1005 KB

A CLI tool for 櫻坂46メッセージ, 日向坂46メッセージ, 乃木坂46メッセージ and 齋藤飛鳥メッセージ app.

License: MIT License

Rust 95.80% Makefile 4.20%
command-line tool cli rust keyakizaka46 hinatazaka46 sakurazaka46 nogizaka46 asukasaito

colmsg's Introduction

⚠️UNDER CONSTRUCtION⚠️

colmsg's People

Contributors

nrngnl avatar proshunsuke avatar s10e-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colmsg's Issues

Main thread panicked at 'called `Option::unwrap()` on a `None` value' using macOS

I got the following error and I used the debugger to find the problem.
I found that the problem is related to the .DS_Store file generated by macOS for storing attributes.
https://en.wikipedia.org/wiki/.DS_Store

When the .DS_Store file is generated in member's folder, the function id_by_filename_format cannot capture the id and it will panic.

Can I make a pull request NRngnl/colmsg@ff89f70?
I am not sure if I should change the functions.

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/message/saver.rs:219:17
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: colmsg::message::saver::id_by_filename_format
   4: colmsg::message::saver::Saver<C>::id_dates::{{closure}}
   5: walkdir::IntoIter::push
   6: walkdir::IntoIter::handle_entry
   7: <walkdir::IntoIter as core::iter::traits::iterator::Iterator>::next
   8: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
   9: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
  10: colmsg::message::saver::Saver<C>::save
  11: colmsg::run_hinatazaka
  12: colmsg::main

README.mdを修正する

  • 特定の日時以降のメッセージを保存したい場合
    • 2020/01/01/ 00:00:002020/01/01 00:00:00
  • TODO
    • swagger specの配置
  • 特徴
    • root化の必要無し
    • android, iphone両方に対応
  • アイコン拝借する

など

想定外のエラーの時にエラーメッセージが分かりにくい

APIのマイナーバージョンが異なっていた際のエラー

[colmsg error]: HTTP status client error (400 Bad Request) for url (https://api.kh.glastonr.net/v2/groups?)

これはこちらの error_for_status を使っており、エラーになった時にレスポンスをエラーにしてしまうので、reqwestのエラーメッセージがそのまま出ている
https://docs.rs/reqwest/0.8.0/reqwest/struct.Response.html#method.error_for_status

colmsgのコードで言うとこの辺

self.handle_response(response, &request_url)

本当はその後のこの部分でエラーを込めて欲しかったが、現状あまり意味を成していない

match result {
Ok(t) => Ok(t),
Err(e) => {
let error_message = format!(
"error: {}, request url: {}, response body: {}", e.to_string(), request_url, &body
);
Err(error_message.into())
}
}

File exists (os error 17)

I can't create down directory and the command is
colmsg --h_refresh_ token "h_refresh_ token"
what is problem? Thanks you

thread 'main' panicked

I have problem when download 宮田愛萌

saving messages of 宮田愛萌...
thread 'main' panicked at 'called Option::unwrap() on a None value', src/message/saver.rs:220:17
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

無限ループしている気がする

100件以上保存出来ない
コマンド実行が終わらないので、無限ループしてずっと同じメッセを取得し続けているような気がする

新参者櫻坂46三期生 bug

There's some sort of bug when running colmsg --s_refresh_token <refresh_token>; it gets stuck downloading to the 新参者櫻坂46三期生 folder and never gets to the other members.

image

As far as I know, the same bug does not occur when downloading to 新参者日向坂46四期生:

image

error : make release/x86_64-darwin

  = note: /home/pro_shunsuke/Documents/osxcross/target/bin/x86_64-apple-darwin14-ld: error while loading shared libraries: libicui18n.so.65: cannot open shared object file: No such file or directory
          clang-10: ¥033[1;31merror: unable to execute command: No such file or directory¥033[0;30m
          clang-10: ¥033[1;31merror: linker command failed due to signal (use -v to see invocation)¥033[0;30m

Can't download messages from previous refresh token

first, i used my refresh token like"7fac6109-....." on my computer
and then i used friend's refresh token "40ef2f64-......".
But when i come back to use my refresh token. program was download data from friend's refresh token.
i tried to restart computer , it wasn't solve my problem

can't download message

C:\Users...\colmsg.exe -n 関有美子 --dir G:\colmsg --h_refresh_token <h_refresh_token> --s_refresh_token <s_refresh_token>

saving messages of 関有美子...
←31m[colmsg error]←[0: error: missing field member_id at line 1 column 1538, request url:

unwrap時のエラー

遅れたけど、あけおめ!
わたしは日本語があまりよくないので、理解されないかもしれない。

そのエラーは2.0verときからもあっている。
一部分のメンバーのidとかdateとか中のparameter違いがある、splitかunwrapときに例外處理のことがしなくて、エラーがあった...(?)
全員購読入していないから、全員のDEBUGログができない。ごめんなさい。
ログ写真を付き
2021-01-01_230115_cened

About adding a function to detect past message and retry downloads

For example, I got a refresh from a friend of mine, and his subscription was earlier than mine. But if you use it directly, you may not be able to get the previous message.
So I was wondering if I could add a detection command that, if used, would compare the local files from the server to see if they exist, and download if they don't, this will also help us to download those who have failed to download due to network problems
In the event of a failed download, add the retry download feature.

Error during maintenance

response during maintenance

% colmsg
[colmsg error]: error: invalid type: map, expected a sequence at line 1 column 10, response body: {"result":{},"status":"FAIL","statuscd":"E700"}

response body json

{
    "result": {},
    "status": "FAIL",
    "statuscd": "E700"
}

詳細なログ出力モードを追加する

ツールが突然死することがありエラーも吐かないので、どこで失敗しているのかが分かりにくい
オプションを渡すと詳細にログを出力するモードを追加する

mac向けのクロスコンパイルについて

概要

mac向けにクロスコンパイルをした
メモを残す

環境

OS: Manjaro Linux

参考URL

手順

基本は上記の手順通り

異なる点

上記の手順はDebian系なので、 Install build dependencies の部分でarch用のパッケージが分からないが、基本的にgccが入っていれば大丈夫そうだった

躓いたところ

Building the project のところで PATH="$(pwd)/osxcross/target/bin:$PATH" としているが、これは Building osxcross でビルドしたものについてパスを通そうとしているので、colmsgをビルドする場合は以下のような感じになる

PATH="/home/pro_shunsuke/Documents/osxcross/target/bin:$PATH" \
cargo build --release --target x86_64-apple-darwin

つまりは pwd をそのまま使うとダメで、 osxcross のパスを通すようにコマンド実行する必要がある
あとリリース用にビルドするのであれば --release が必要

こんな感じになる

pro_shunsuke:[~/Documents/colmsg][2:32:11]-[master]
% ls target/
debug/  release/  x86_64-apple-darwin/
pro_shunsuke:[~/Documents/colmsg][3:13:34]-[master]
% ls target/x86_64-apple-darwin/release/
build/  colmsg*  colmsg.d  deps/  examples/  incremental/  libcolmsg.d  libcolmsg.rlib

エラーメッセージを出ました

使用の際にこのメッセージを出ました
僕は普通に使用したけど
�[31m[colmsg error]�[0m: HTTP status client error (400 Bad Request) for url (https://api.kh.glastonr.net/v2/update_token)

can't download message

C:\Users...\colmsg.exe -n 大園玲 --dir G:\colmsg --h_refresh_token <h_refresh_token> --s_refresh_token <s_refresh_token>

←31m[colmsg error]←[0: error: missing field member_id at line 1 column 1551, request url:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.