Code Monkey home page Code Monkey logo

netease_cloudmusic_discord_rpc's Introduction

netease_cloudmusic_discord_rpc's People

Contributors

aliencaocao avatar frzmtrsprt avatar lekoowo avatar moeshin 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

Watchers

 avatar  avatar

netease_cloudmusic_discord_rpc's Issues

V3.0 beta client support

It seems like V3.0 added address randomisation causing the pointer offsets to be random on each machine. Code for reading them already works IF the randomisation can be solved. E.g., offsets found are only valid for that session.
Waiting for V3.0 to stabilize then try to find another way to read song id.

Support for beta client V3.0

Netease just released a new beta client V3.0.0 build 201589 x64. I have found the offset total length but cant find the sound array within the whole cloudmusic.dll memory (using cheat engine full memory scan with unicode ticked). There are many instances of the song id in the entire scope (main exe+all DLLs) but I can't find one that reliably gives the song id. Most of them seem to partially give with 1 byte off (set to 0x00 when it should be in ASCII e.g. 0x30 onwards). I need some help with scanning the song array.

Besides, the current offset also cant be found. All those I found seem to be static, they don't update as the song plays. I think they upgraded their anti-debugging feature.

Tagging original contributor of song array feature @lekoOwO and RE expert @twinklestar03

Update fails after Discord restart

After restarting Discord, update will fail with an InvalidID exception. The traceback is as follows.

  File "...\pypresence\baseclient.py", line 81, in read_output
    preamble = await self.sock_reader.read(8)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [WinError 232] The pipe has been ended.

During handling of the above exception, another exception occurred:

  File "...\pypresence\baseclient.py", line 85, in read_output
    raise InvalidID
  File "...\pypresence\presence.py", line 34, in update
    return self.loop.run_until_complete(self.read_output())
  File "...\main.py", line 227, in update
    RPC.update(pid=pid,
  File "...\main.py", line 47, in _target
    self.function()
pypresence.exceptions.InvalidID: Client ID is Invalid

This is clearly pypresence's bug (see #213), and we'll have to wait for pypresence to fix this.

Below is a temporary fix.

try:
    RPC.update(state="test")  # InvalidID after Discord restart
except InvalidID:
    print("Reconnecting")
    RPC.connect()  # RuntimeError: There is no current event loop in thread 'Thread-1 (_target)'.

Then we run into the second bug: RuntimeError: There is no current event loop in thread 'Thread-1 (_target)'.

It happened when Presence tries to renew the event loop in connect(), but fails to handle the exception when it can't find a existing one.

This bug is fixed in #210, which has been waiting for approval for two weeks.

V0.3.0 regression with V2.x clients

Discussed in #28

Originally posted by JdumB October 24, 2023

TLDR of discussion: V0.2.8 works, V0.3.0 does not work for client V2.10.11. To test on client V2.10.12.

Fails to update presence when album name is one character long

When the album name is only one character long (e.g. 𠷡), the program throws the following exception

Child "activity" fails because child "assets" fails because child "large_text" fails because "large_text" length must be at least 2 characters long

This can be solved by adding spaces to the album name, they get removed on the webpage anyway.

Failing windows build actions due to missing version.txt

run: create-version-file version.yml --outfile version.txt

This line is somehow causing issue as it is not outputting the version.txt to the working dir, causing subsequent pyinstall build to fail.

EDIT: see comment below. the file is there but pyinstaller complains is not there. I cannot reproduce this issue locally.

This issue does not affect the functionality of the code. Users can still build their own binaries or download the prebuilt exes from releases page.

Fails to get `song_id` for some songs

When the song's id is shorter than 10 digits, the program still tries to get the 10 characters after the songid_array address, causing it fail to acquire song_info.

song_id = r_bytes(process, songid_array, 0x14).decode('utf-16')

image
image

Show music status in presence

Current behaviour

Music status is not displayed, and music progress is constantly updated even when music is paused

Improved behaviour

Music status (Playing or Paused) is displayed in a small icon at the corner of the album art, and music progress is hidden when music is paused

Example

image
image

Note that the small icon should be replaced with a play / pause icon, but I haven't found them yet.

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.