- 🌱 I’m currently learning rust
- 👯 I’m looking to collaborate on rust python websec
RUSTTTTT!!!
netease cloud music terminal client by rust :zap:
License: MIT License
When playing some specific songs ,the program is always crash. But,rarely,it will works just fine.
Here's the log
[00:00:00.000] (7fd367e13b40) INFO start netease cloud music rust client
[00:00:00.183] (7fd367e13b40) DEBUG init player
[00:00:00.191] (7fd3630d5640) DEBUG starting new connection: https://music.163.com/
[00:00:00.192] (7fd362ed4640) DEBUG resolving host="music.163.com"
[00:00:00.204] (7fd3630d5640) DEBUG connecting to [2407:ae80:200:1001::20]:443
[00:00:00.241] (7fd3630d5640) DEBUG connected to [2407:ae80:200:1001::20]:443
[00:00:00.280] (7fd3630d5640) DEBUG flushed 1093 bytes
[00:00:00.460] (7fd3630d5640) DEBUG read 1888 bytes
[00:00:00.460] (7fd3630d5640) DEBUG parsed 15 headers
[00:00:00.460] (7fd3630d5640) DEBUG incoming body is chunked encoding
[00:00:00.460] (7fd3630d5640) DEBUG incoming chunked header: 0x587 (1415 bytes)
[00:00:00.460] (7fd3630d5640) DEBUG response '200 OK' for https://music.163.com/
[00:00:00.461] (7fd3630d5640) DEBUG read 765 bytes
[00:00:00.461] (7fd3630d5640) DEBUG incoming chunked header: 0x2F6 (758 bytes)
[00:00:00.461] (7fd3630d5640) DEBUG read 633 bytes
[00:00:00.461] (7fd3630d5640) DEBUG incoming chunked header: 0x272 (626 bytes)
[00:00:00.461] (7fd3630d5640) DEBUG read 654 bytes
[00:00:00.461] (7fd3630d5640) DEBUG incoming chunked header: 0x287 (647 bytes)
[00:00:00.462] (7fd3630d5640) DEBUG read 738 bytes
[00:00:00.462] (7fd3630d5640) DEBUG incoming chunked header: 0x2DB (731 bytes)
[00:00:00.462] (7fd3630d5640) DEBUG read 1276 bytes
[00:00:00.462] (7fd3630d5640) DEBUG incoming chunked header: 0x4F5 (1269 bytes)
[00:00:00.465] (7fd3630d5640) DEBUG read 2502 bytes
[00:00:00.465] (7fd3630d5640) DEBUG incoming chunked header: 0x9BF (2495 bytes)
[00:00:00.470] (7fd3630d5640) DEBUG read 7213 bytes
[00:00:00.470] (7fd3630d5640) DEBUG incoming chunked header: 0x1C25 (7205 bytes)
[00:00:00.504] (7fd3630d5640) DEBUG read 8192 bytes
[00:00:00.504] (7fd3630d5640) DEBUG incoming chunked header: 0x2DF1 (11761 bytes)
[00:00:00.504] (7fd3630d5640) DEBUG read 3577 bytes
[00:00:00.506] (7fd3630d5640) DEBUG read 1399 bytes
[00:00:00.506] (7fd3630d5640) DEBUG incoming chunked header: 0x570 (1392 bytes)
[00:00:00.507] (7fd3630d5640) DEBUG read 20 bytes
[00:00:00.507] (7fd3630d5640) DEBUG incoming chunked header: 0xA (10 bytes)
[00:00:00.507] (7fd3630d5640) DEBUG incoming body completed
[00:00:00.507] (7fd3630d5640) DEBUG pooling idle connection for ("https", music.163.com)
[00:00:00.509] (7fd367e13b40) INFO start mpris thread
[00:00:00.509] (7fd367e13b40) INFO finish mpris thread
[00:00:00.510] (7fd36279f640) INFO start
[00:00:00.511] (7fd367e13b40) DEBUG 2883 instructions outputed.
[00:00:00.511] (7fd3630d5640) DEBUG reuse idle connection for ("https", music.163.com)
[00:00:00.511] (7fd3630d5640) DEBUG flushed 1946 bytes
[00:00:00.581] (7fd3630d5640) DEBUG read 1572 bytes
[00:00:00.581] (7fd3630d5640) DEBUG parsed 16 headers
[00:00:00.581] (7fd3630d5640) DEBUG incoming body is content-length (7458 bytes)
[00:00:00.581] (7fd3630d5640) DEBUG response '200 OK' for https://music.163.com/weapi/user/playlist
[00:00:00.581] (7fd3630d5640) DEBUG read 1448 bytes
[00:00:00.582] (7fd3630d5640) DEBUG read 1448 bytes
[00:00:00.584] (7fd3630d5640) DEBUG read 3474 bytes
[00:00:00.585] (7fd3630d5640) DEBUG incoming body completed
[00:00:00.585] (7fd3630d5640) DEBUG pooling idle connection for ("https", music.163.com)
[00:00:00.586] (7fd367e13b40) DEBUG 546 instructions outputed.
[00:00:00.760] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:01.011] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:01.260] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:01.495] (7fd367e13b40) DEBUG 26 instructions outputed.
[00:00:01.495] (7fd367e13b40) INFO send msg "Playlist"
[00:00:01.510] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:01.510] (7fd367e13b40) INFO send msg "null"
[00:00:01.658] (7fd367e13b40) DEBUG 26 instructions outputed.
[00:00:01.658] (7fd367e13b40) INFO send msg "Stopped"
[00:00:01.760] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:01.760] (7fd367e13b40) INFO send msg "0"
[00:00:02.010] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:02.010] (7fd367e13b40) INFO send msg "false"
[00:00:02.260] (7fd367e13b40) DEBUG 28 instructions outputed.
[00:00:02.260] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:02.300] (7fd367e13b40) DEBUG 28 instructions outputed.
[00:00:02.339] (7fd367e13b40) DEBUG 32 instructions outputed.
[00:00:02.381] (7fd367e13b40) DEBUG 33 instructions outputed.
[00:00:02.420] (7fd367e13b40) DEBUG 26 instructions outputed.
[00:00:02.462] (7fd367e13b40) DEBUG 26 instructions outputed.
[00:00:02.502] (7fd367e13b40) DEBUG 28 instructions outputed.
[00:00:02.510] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:02.541] (7fd367e13b40) DEBUG 28 instructions outputed.
[00:00:02.761] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:03.012] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:03.261] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:03.294] (7fd367e13b40) DEBUG 29 instructions outputed.
[00:00:03.425] (7fd367e13b40) DEBUG 29 instructions outputed.
[00:00:03.512] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:03.762] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:03.870] (7fd367e13b40) DEBUG 27 instructions outputed.
[00:00:04.011] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:04.048] (7fd367e13b40) DEBUG 27 instructions outputed.
[00:00:04.261] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:04.512] (7fd367e13b40) DEBUG 298 instructions outputed.
[00:00:04.513] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:04.763] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:04.916] (7fd3630d5640) DEBUG reuse idle connection for ("https", music.163.com)
[00:00:04.916] (7fd3630d5640) DEBUG flushed 2039 bytes
[00:00:05.006] (7fd3630d5640) DEBUG read 1572 bytes
[00:00:05.006] (7fd3630d5640) DEBUG parsed 16 headers
[00:00:05.006] (7fd3630d5640) DEBUG incoming body is content-length (3076 bytes)
[00:00:05.006] (7fd3630d5640) DEBUG response '200 OK' for https://music.163.com/weapi/v3/playlist/detail
[00:00:05.006] (7fd3630d5640) DEBUG read 1987 bytes
[00:00:05.006] (7fd3630d5640) DEBUG incoming body completed
[00:00:05.006] (7fd3630d5640) DEBUG pooling idle connection for ("https", music.163.com)
[00:00:05.007] (7fd367e13b40) DEBUG 2115 instructions outputed.
[00:00:05.012] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:05.262] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:05.513] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:05.685] (7fd367e13b40) DEBUG 189 instructions outputed.
[00:00:05.762] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:05.902] (7fd367e13b40) DEBUG 143 instructions outputed.
[00:00:06.012] (7fd367e13b40) DEBUG 0 instructions outputed.
[00:00:06.180] (7fd3630d5640) DEBUG reuse idle connection for ("https", music.163.com)
[00:00:06.180] (7fd3630d5640) DEBUG flushed 1974 bytes
[00:00:06.242] (7fd3630d5640) DEBUG read 839 bytes
[00:00:06.242] (7fd3630d5640) DEBUG parsed 16 headers
[00:00:06.242] (7fd3630d5640) DEBUG incoming body is content-length (356 bytes)
[00:00:06.242] (7fd3630d5640) DEBUG incoming body completed
[00:00:06.242] (7fd3630d5640) DEBUG pooling idle connection for ("https", music.163.com)
[00:00:06.242] (7fd3630d5640) DEBUG response '200 OK' for https://music.163.com/weapi/song/enhance/player/url
[00:00:06.242] (7fd367e13b40) INFO Song {
id: Some(
28762569,
),
url: Some(
"http://m8.music.126.net/20220408002902/41e7fd36575fd33217c26095b9b44739/ymusic/4b6e/9a9b/773b/c3269086d3e3245360dab5257a02161a.mp3",
),
}
[00:00:06.249] (7fd36259e640) DEBUG starting new connection: http://m8.music.126.net/
[00:00:06.249] (7fd361b99640) DEBUG resolving host="m8.music.126.net"
[00:00:06.258] (7fd36259e640) DEBUG connecting to [2409:8c14:e04:1204:3::3f6]:80
[00:00:06.263] (7fd36259e640) DEBUG connected to [2409:8c14:e04:1204:3::3f6]:80
[00:00:06.264] (7fd361d9a640) DEBUG flushed 474 bytes
[00:00:06.275] (7fd36219c640) DEBUG read 2739 bytes
[00:00:06.275] (7fd36219c640) DEBUG parsed 30 headers
[00:00:06.275] (7fd36219c640) DEBUG incoming body is content-length (3807809 bytes)
[00:00:06.275] (7fd36259e640) DEBUG response '200 OK' for http://m8.music.126.net/20220408002902/41e7fd36575fd33217c26095b9b44739/ymusic/4b6e/9a9b/773b/c3269086d3e3245360dab5257a02161a.mp3
[00:00:06.275] (7fd36259e640) DEBUG start download
[00:00:06.275] (7fd36259e640) DEBUG first chunk
[00:00:06.275] (7fd36219c640) DEBUG read 7320 bytes
[00:00:06.275] (7fd36219c640) DEBUG read 2440 bytes
#Just The Similar Logs. The Only Differences Is The Number Of Bytes.
[00:00:06.346] (7fd361f9b640) DEBUG read 4880 bytes
[00:00:06.346] (7fd361f9b640) DEBUG read 10209 bytes
[00:00:06.346] (7fd361f9b640) DEBUG incoming body completed
[00:00:06.346] (7fd361f9b640) DEBUG pooling idle connection for ("http", m8.music.126.net)
[00:00:06.346] (7fd36259e640) DEBUG finish downloa
[00:00:06.493] (7fd367e13b40) ERROR thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }': src/player/track.rs:82
[00:00:06.493] (7fd367e13b40) DEBUG Shutting down player thread ...
Full log is here
ncmt.log
With a result like spotifyd did.
I'm not familiar with GStreamer, is there any easy way like plugins to introduce?
OS: Ubuntu for WSL
Setting:
# Your account username (email/cellphone).
username = "13***27"
# Your account password.
password = "W***!"
and this error occured:
Finished dev [unoptimized + debuginfo] target(s) in 0.11s
Running `target/debug/ncmt`
Error: ErrorMessage { msg: "Account/Password Error" }
I've tried many times. Please help tackle the issue.
error: failed to run custom build command for libdbus-sys v0.2.1
Caused by:
process didn't exit successfully: PATH/netease-music-tui/target/release/build/libdbus-sys-a422a3c3b2ac2af0/build-script-build
(exit code: 101)
--- stderr
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Failure { command: ""pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\nPackage dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing
dbus-1.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'dbus-1' found\n" } }', src/libcore/result.rs:1165:5
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
这个应用在运行的时候,会使用太多的性能,在终端运行的时候,cpu占用50%,而桌面应用才5%,
如果终端应用在性能上没有优势,那也没太大必要啊。
建议改为 async 方式
$ ncmt
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: newline in string found at line 2', src/main.rs:74:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
rustc 1.51.0
environment:
I have tried run releases which throws
thread 'main' panicked at 'No device name: BackendSpecific { err: BackendSpecificError { description: "core foundation unexpectedly returned null string" } }', src/libcore/result.rs:1165:5
Then I tried build from source code, got
thread 'main' panicked at 'No device name: BackendSpecific { err: BackendSpecificError { description: "core foundation unexpectedly returned null string" } }', /Users/abc/.cargo/registry/src/github.com-1ecc6299db9ec823/rodio-0.10.0/src/engine.rs:113:32
Cargo.toml
[package]
name = "netease_music_tui"
version = "0.1.1"
authors = ["betta <[email protected]>"]
license = "MIT"
keywords = ["netease", "player", "music", "tui"]
repository = "https://github.com/betta-cyber/netease-music-tui"
categories = ["rodio"]
edition = "2018"
package version is stll 0.1.1 on 0.1.2 release
it seem cause build error
Environment: MacOS Catalina 10.15.3
Souce: From release binay
Description: ncmt logged in successfully. I can see all of my playlists. However, when I tried to play one of the songs, an error jumped up:
Read <unnamed> panicked at 'error thread task: reqwest::Error{kind:Request, url: http://m7.music.126.net/...", source: hyper::Error(Connect, "socks connect error:Proxy server unreachable")}', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
What's even worst is that when the error jumped out, the whole session froze. I'll have to force-close it.
I'm completely new to Rust.. Is there any solution to this?
[00:00:07.249] (7fddaaaaf700) DEBUG Response: '400 Bad Request' for http://m701.music.126.net/20200331191119/aced0a81c4a36b33eae1dc5bec16a162/jdymusic/obj/w5zDlMODwrDDiGjCn8Ky/1908976826/b1e0/3f69/41d7/7a37116010b3e13749b4c4e595f50e1d.mp3
[00:00:07.249] (7fddaa6ad700) DEBUG pooling idle connection for "http://m701.music.126.net"
[00:00:07.249] (7fddb4678b80) ERROR thread 'main' panicked at 'called Result::unwrap()
on an Err
value: MP3DurationError { kind: UnexpectedFrame { header: 1010792557 }, offset: 4, at_duration: 0ns }': src/libcore/result.rs:1165
[00:00:07.250] (7fddb4678b80) DEBUG Shutting down player thread ...
[00:00:04.815] (7fb196b50700) DEBUG pooling idle connection for "http://m701.music.126.net"
[00:00:04.815] (7fb196b50700) DEBUG Response: '400 Bad Request' for http://m701.music.126.net/20200331190913/2a752d880905be71f1a4d560ff8fdbfa/jdymusic/obj/w5zDlMODwrDDiGjCn8Ky/1982546996/e9f4/7bd8/7593/48cae3e5ebe3198ac37a5243dfc7c821.mp3
[00:00:04.815] (7fb1a07a0b80) ERROR thread 'main' panicked at 'called Result::unwrap()
on an Err
value: MP3DurationError { kind: UnexpectedFrame { header: 1010792557 }, offset: 4, at_duration: 0ns }': src/libcore/result.rs:1165
[00:00:04.816] (7fb1a07a0b80) DEBUG Shutting down player thread ...
cargo --version
cargo 1.32.0 (8610973aa 2019-01-02)
......
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
--> /Users/yaoqiwan/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:31:5
|
31 | use core::convert::TryInto;
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
--> /Users/yaoqiwan/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:89:71
|
89 | let read_usize = |bytes: &[u8]| u64::from_ne_bytes(bytes[..8].try_into().unwrap());
| ^^^^^^^^
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
--> /Users/yaoqiwan/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:98:60
|
98 | hash.add_to_hash(u32::from_ne_bytes(bytes[..4].try_into().unwrap()) as usize);
| ^^^^^^^^
error[E0658]: use of unstable library feature 'try_from' (see issue #33417)
--> /Users/yaoqiwan/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:102:60
|
102 | hash.add_to_hash(u16::from_ne_bytes(bytes[..2].try_into().unwrap()) as usize);
| ^^^^^^^^
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0658`.
error: Could not compile `rustc-hash`.
warning: build failed, waiting for other jobs to finish...
error: build failed
gstreamer is too complex for this music player. so we need remove it.
please support arm7, arm64 etc.
I want to run it in Raspberry Pi 3b+
since the bin name is ncmt
, which is short for netease-cloud-music-tui
maybe netease-cloud-music-tui
is better ?
When playing flac audio, this program will exit
I've been getting login failures since installing from the AUR.
After downloading and compiling manually, I've been able to retrieve the following message from the login post:
[src/api.rs:243] &result = "{\"code\":-462,\"data\":{\"actionCode\":\"1102401\",\"verifyType\":50,\"verifyId\":1,\"verifyUrl\":\"\",\"blockText\":\"网络太拥挤,请稍候再试。\",\"verifyToken\":null,\"btnText\":null,\"orpheusUrl\":null,\"frontRuleIds\":[1076401,1085401,1102401],\"params\":{\"event_id\":\"...\",\"sign\":\"...\"},\"url\":null},\"message\":\"网络太拥挤,请稍候再试。\"}"
When try to input space in search bar, it will stop the music, but not input space in search bar.
Some times run the application ,Throw 《stream did not contain valid UTF-8》, I'm new to Rust。But I found the problem。
netease some times will respond the "content-encoding:br" in header.So the reqwest crash。
bug fix in api.rs
headers.insert(ACCEPT_ENCODING, "gzip,deflate,br".parse().unwrap());
change to
headers.insert(ACCEPT_ENCODING, "gzip,deflate".parse().unwrap());
then solved。
There are none errors throw out.Just the application exit.I don't know how to debug in rust.
Is there anyone like me?
rt
ncmt
fail to execute with the following error message.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: reqwest::Error { kind: Request, url: "https://music.163.com/", source: hyper::Error(Connect, Ssl(Error { code: ErrorCode(1), cause: Some(Ssl(ErrorStack([Error { code: 337047686, library: "SSL routines", function: "tls_process_server_certificate", reason: "certificate verify failed", file: "ssl/statem/statem_clnt.c", line: 1913 }]))) }, X509VerifyResult { code: 62, error: "Hostname mismatch" })) }', src/libcore/result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
Caused by host file being edited to redirect music.163.com
Possible fix: don't change hosts (not application for people overseas)
Also, when trying to access ip limited songs when overseas ncmt
will also crash.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.