Skip to content

Conversation

listen1
Copy link
Owner

@listen1 listen1 commented Apr 3, 2025

Problem

After upgrade electron, search is not available for netease and bilibili for desktop app.

Reason

It seems electron use more strict cookie access when make cross domain request. Cookie should set sameSite to no-restriction instead of lax to let request bring cookie in local.
And netease has change auth method as well, now NMTID cookie should be provided, but value is not checked.

Solution

  • Change cookie object sameSite field value to no-restriction
  • Set netease NMTID cookie value

Future work

  • Deep investivate for cross domain cookie policy, because chrome browser has already showed warning for that. Maybe this method would not be working in the future.
  • Netease NMTID fetched from site instead of fixed value.

@listen1 listen1 merged commit de8efa8 into master Apr 4, 2025
1 check passed
@listen1 listen1 deleted the fix-cookie branch April 4, 2025 11:10
@mikelxk
Copy link
Collaborator

mikelxk commented Apr 5, 2025

The search still isn't working for me, the api endpoint is returning unrelevant garbage for me (I searched completely different stuff), maybe we still need a valid nmtid?
image

@listen1
Copy link
Owner Author

listen1 commented Apr 6, 2025

The search still isn't working for me, the api endpoint is returning unrelevant garbage for me (I searched completely different stuff), maybe we still need a valid nmtid? image

I think you're right. Need more work to get correct NMTID. The previous version is working because NMTID is refreshed when I use playlist api.

@listen1
Copy link
Owner Author

listen1 commented Apr 6, 2025

I submit a commit to fix in master branch. The problem is netease need 3 cookies to work, so nmtid can be any value only if other 2 cookies set correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants