Use the Chrome extension NetEaseMusicWorld++ to unlock overseas NetEase Music access.
It's run by Github Actions, so no self-hosted server is needed. Alternatively, you can run by local browser cache.
Chinese Documentation is available in 中文文档.
✅Windows 8.1/10/11 (x86_64)
✅Linux (Only for x86_64 CPU)
✅MacOS
- Fork this repository (and star if you like it)
- In your own repository, enter your config json that should be filled in
config.jsonas the value of Github Action repository secrets namedCONFIG, but DO NOT fill in the JSON file to expose cookies. - Run Github Action
Unlock-NetEaseMusic(It will run automatically every day.)
1. Install python packages: pip install -r requirements.txt
2. Enter your email address and password in auto_login.py
3. Run auto_login.py
-
Open the Chrome on your local computer to login Netease Music, then use Inspect tool of the Chrome to find the cookie named
MUSIC_Uand copy its value for the later use.
If you find it difficult to use Inspect tool to obtain cookie, you can use our help procedure to automatically obtain, by executingpython cookie_extract.py. In this case, the browser will be automatically opened for you to login, after completing the login, press Enter to continue and the obtained cookie will be printed on the terminal. -
Install python packages:
pip install -r requirements.txt -
When run by local browser cache, the email, password, userDataDir and profileName in
config.jsonare not needed, so you can casually fill them in or leave them blank. HOWEVER, these fields must NOT be deleted from the json file, otherwise it will prevent json from being read.
Enter the value of login_cookie that we obtained in step 1.
Enter your chrome profile path inconfig.json, this path is usuallyC:\\Users\\YourUser\\AppData\\Local\\Google\\Chrome\\User Datafor Windows. This path can also be found inchrome://version/. -
Set the timer for repeating the task.
-
Run
python local_login.py
Note: This method only supports x86_64 architecture CPU
- Run
docker build -t netease .to build the Docker image. - Follow the step 1 in Run by local browser cache to obtain the login cookie.
- After filling config json into
config.json, rundocker run -v $PWD/config.json:/app/config.json neteaseto launch the Docker container and mount the json file.
We support single user mode and multi-user mode.
Single User:
{
"userDataDir": "C:\\Users\\YourUser\\AppData\\Local\\Google\\Chrome\\User Data",
"email": "test",
"password": "test123",
"login_cookie": "xxx"
}Multi-User:
{
"users": [
{
"userDataDir": "C:\\Users\\YourUser\\AppData\\Local\\Google\\Chrome\\User Data",
"email": "test",
"password": "test123",
"name": "tt",
"profileName": "profile 1",
"login_cookie": "xxx"
},
{
"userDataDir": "C:\\Users\\YourUser\\AppData\\Local\\Google\\Chrome\\User Data",
"email": "test",
"password": "test123",
"name": "user2",
"profileName": "profile 2",
"login_cookie": "xxx"
}
]
}To run in multi-account mode, you need to login and fill in the login_cookie for every Netease Music account.
To run in multi-account mode, you need to create multiple Chrome profiles, and login your respective account in each profile. Then in the config.json, you need to fill in different profile names for each profile.
Each cookie obtained by login has about 1-month expire duration, which is not valid forever. Therefore, after about one month, you need to login again to obtain a new cookie.
When you login to https://music.163.com in Chrome the extension NetEaseMusicWorld++ will automatically run a script to make NetEase believe that your IP is in China. Once this is done, NetEase will allow you to access music in all platforms (e.g. on phone apps) for a short time (unclear) even if you access from a foreign IP.
The Github Action will run daily to do the above actions and unlock you from the foreign IP restriction.
When you use local browser cache to execute, the script would use the cookie in your local browser to play songs, but you have to manully login the account in advance to obtain the cookie.
This repo was forked from Lennox-Elaphurus/Unlock-NetEaseMusic. Due to the original repo has been archived, we decided to detach the fork connection for the future maintenance, and this also makes this repo enabled to be indexed by people, as forked repo is not indexed on GitHub by default.