English | [简体中文](README.md)


[](https://github.com/MeoProject/lx-music-api-server/actions/workflows/build_beta.yml)
[](https://github.com/MeoProject/lx-music-api-server/releases/latest)
[](https://github.com/MeoProject/lx-music-api-server/releases)
[](https://github.com/MeoProject/lx-music-api-server/blob/main/LICENSE)
This project [Document](https://apidoc.zcmonety.xyz)
**Ban** and other situations caused by the use of this project have **nothing** to do with this project.
This project does not accept private customization, and the problems that occur in the non-**Github release of this project** have nothing to do with this project**
## 💡Feature
- [ ] Functions
- [ ] All APIs (playlist, search)
- [x] Netease Cloud Refresh Login
- [ ] Client plays music on webdav
- [x] Client plays local music on the server
- [x] Cookie pool
- [x] HTTPS listening, multi port listening
- [x] Reverse proxy compatibility
- [x] Get higher quality
- [x] QRC decrypt
- [ ] Localization (currently only Simplified Chinese is supported)
- [x] Platform support: `Windows` `Linux` `MacOS`
## 💻How to deploy
### Use Release (recommended)
1. Download the executable file corresponding to your system from [Releases](https://github.com/MeoProject/lx-music-api-server/releases) or [Actions](https://github.com/MeoProject/lx-music-api-server/actions)
2. Run the downloaded executable file (maybe you need to unzip the downloaded file if it is a compressed files)
---
### Use Poetry
Required environment: Python 3.8+
1. Install poetry
```bash
pip install poetry
```
2. Clone this project and enter the project directory
```bash
git clone https://github.com/MeoProject/lx-music-api-server.git
cd lx-music-api-server
```
3. Install requirements
```bash
poetry install --no-root
```
4. Run it
```bash
poetry shell # enter poetry environment
python main.py # run project
```
---
### Directly deploy
Required environment: Python 3.6 - 3.11, Python 3.8+ is better.
Python 3.12 or higher maybe install requirements failed.
Without other restrictions, you can run only with Python.
If you are using linux, you command maybe python3, please replace it yourself.
1. Clone this project and enter the project directory
```bash
git clone https://github.com/MeoProject/lx-music-api-server.git
cd lx-music-api-server
```
2. Install requirements
```bash
python -m pip install -r ./requirements.txt
```
3. Run it
```bash
python main.py
```
## 📖Return code description
The code meaning in the `body.code` field value in the interface return value.
| Value | Meaning |
| ---- | --------------------------------------------------- |
| 0 | Success |
| 1 | IP is banned or does not support anti-generation |
| 2 | Fail to obtain. |
| 4 | Server internal error (corresponding to statuscode 500) |
| 5 | Too frequent requests |
| 6 | Parameter error |
The code meaning of `statuscode` returned by the interface.
| Value | Meaning |
| ---- | -------------------------------------------------- |
| 200 | Success |
| 403 | IP is banned |
| 400 | Parameter error |
| 429 | Too frequent requests |
| 500 | Server internal error (corresponding to body.code 4) |
## 🔖Remarks
### The following excellent codes may appear in this project.
1. Triangle has stability.
```python
for a in xxx:
if (xxx):
if (xxx):
if (xxx):
for b in xxx:
if (xxx):
while (xxx):
pass
pass
pass
pass
pass
pass
pass
```
2. If you can finish it in one line, then don't write many lines.
```python
sys.stdout.write('\r|'+'=' * (int(dd['pares'].index(ds) / total * 50)) + ' ' * (49 - int(dd['pares'].index(ds) / total * 50)) + f'''|{int(dd['pares'].index(ds) / total * 100)}% xx''' + ds['title']+' ' * 20)
```
3. Do not reuse duplicate parts
```python
async def other(method, source, songid, _):
try:
func = require('modules.' + source + '.' + method)
except:
return {
'code': 1,
'msg': '未知的源或不支持的方法',
'data': None,
}
try:
result = await func(songid)
return {
'code': 0,
'msg': 'success',
'data': result
}
except FailedException as e:
return {
'code': 2,
'msg': e.args[0],
'data': None,
}
async def other_with_query(method, source, t, _, query):
try:
func = require('modules.' + source + '.' + method)
except:
return {
'code': 1,
'msg': '未知的源或不支持的方法',
'data': None,
}
try:
result = await func(t, query)
return {
'code': 0,
'msg': 'success',
'data': result
}
except FailedException as e:
return {
'code': 2,
'msg': e.args[0],
'data': None,
}
```
4. Module does not split
Details at [config.py](https://github.com/MeoProject/lx-music-api-server/tree/main/common/config.py)
5. Unknown variable name
```python
a = '小明'
b = 1
c = 2
d = b''
def e(a, b, c):
c = xxx
d = xxx
f = e(c, b, a)
```
## 📄Project agreement
This project is issued under [MIT](https://github.com/MeoProject/lx-music-api-server/blob/main/LICENSE) license. The following agreement is a supplement to the original MIT agreement. In case of conflict, the following agreement shall prevail.
Word agreement: "this project" in this agreement refers to this audio source project; "User" means the user who signed this Agreement; "Official Music Platform" refers to the official platforms built in this project, including Cool Me, Cool Dog, Mi Gu and other music sources; "Copyright data" refers to data of which others have copyright, including but not limited to images, audio, names, etc.
1. The data source principle of this project is to pull data from the public servers of official music platforms, and display the data after simple screening and merging, so this project is not responsible for the accuracy of the data.
2. Copyright data may be generated during the use of this project, and this project does not own the copyright data. In order to avoid infringement, users must clear the copyright data generated during the use of this project within **24 hours**.
3. Any direct, indirect, special, accidental or consequential damages of any nature arising from the use of this project (including but not limited to damages caused by loss of goodwill, shutdown, computer failure or malfunction, or any and all other commercial damages or losses) shall be borne by the user.
4. This project is completely free of charge, and the open source is published on GitHub for people all over the world to learn and exchange technology. This project does not guarantee that the technology in the project may violate local laws and regulations. **It is forbidden to use this project in violation of local laws and regulations.** The user shall bear any illegal acts caused by the user knowing or not knowing that the local laws and regulations do not allow it, and this project will not bear any direct, indirect, special, accidental or consequential responsibilities.
If you use this project, you will accept the above agreement on your behalf.
Music platform is not easy, please respect copyright and support genuine.
This project is only used for the exploration and research of technical feasibility, and does not accept any commercial (including but not limited to advertising) cooperation and donation.
If you have any questions about this, please mail to:
helloplhm-qwq+outlook.com
folltoshe+foxmail.com
(please replace `+` to `@`)
## ✨Star trend chart
[](https://starchart.cc/MeoProject/lx-music-api-server)
## ⚙️Contributor
[](https://github.com/MeoProject/lx-music-api-server/graphs/contributors)