Compare commits
No commits in common. "master" and "v0.3.1" have entirely different histories.
|
|
@ -1,16 +0,0 @@
|
||||||
node_modules
|
|
||||||
npm-debug.log
|
|
||||||
Dockerfile*
|
|
||||||
docker-compose*
|
|
||||||
.dockerignore
|
|
||||||
.git
|
|
||||||
.github
|
|
||||||
.gitignore
|
|
||||||
README.md
|
|
||||||
LICENSE
|
|
||||||
.vscode
|
|
||||||
dist
|
|
||||||
dist_electron
|
|
||||||
build
|
|
||||||
images
|
|
||||||
script
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
VUE_APP_NETEASE_API_URL=/api
|
VUE_APP_NETEASE_API_URL=http://127.0.0.1:3000
|
||||||
VUE_APP_ELECTRON_API_URL=/api
|
VUE_APP_ELECTRON_API_URL=/api
|
||||||
VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:10754
|
VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:3000
|
||||||
VUE_APP_LASTFM_API_KEY=09c55292403d961aa517ff7f5e8a3d9c
|
VUE_APP_ENABLE_SENTRY=false
|
||||||
VUE_APP_LASTFM_API_SHARED_SECRET=307c9fda32b3904e53654baff215cb67
|
|
||||||
DEV_SERVER_PORT=20201
|
DEV_SERVER_PORT=20201
|
||||||
|
|
||||||
|
|
|
||||||
4
.envrc
|
|
@ -1,4 +0,0 @@
|
||||||
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
|
|
||||||
|
|
||||||
export NIXPKGS_ALLOW_INSECURE=1
|
|
||||||
use devenv
|
|
||||||
7
.gitattributes
vendored
|
|
@ -1,7 +0,0 @@
|
||||||
* text eol=lf
|
|
||||||
# Denote all files that are truly binary and should not be modified.
|
|
||||||
*.png binary
|
|
||||||
*.jpg binary
|
|
||||||
*.mp3 binary
|
|
||||||
*.icns binary
|
|
||||||
*.gif binary
|
|
||||||
21
.github/ISSUE_TEMPLATE/----------.md
vendored
|
|
@ -1,21 +0,0 @@
|
||||||
---
|
|
||||||
name: 反馈问题或请求新功能
|
|
||||||
about: bug & feature
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# 尽量每个 issue 只提一个 bug 或新功能
|
|
||||||
|
|
||||||
### 提新 issue 前请确认 👉
|
|
||||||
|
|
||||||
- 没人提过这个 issue([这里看所有 issue](https://github.com/qier222/YesPlayMusic/issues))
|
|
||||||
- 项目的 Todo 里没有与你 issue 相关的内容([这里看 Todo](https://github.com/qier222/YesPlayMusic/projects/1))
|
|
||||||
|
|
||||||
### 反馈 bug 需要的信息
|
|
||||||
|
|
||||||
- 用的是网页版还是客户端
|
|
||||||
- 浏览器名称或电脑操作系统
|
|
||||||
- 控制台 Console 页面的截图(按 F12 可打开控制台)
|
|
||||||
93
.github/workflows/build.yaml
vendored
|
|
@ -1,15 +1,6 @@
|
||||||
name: Release
|
name: Build/release
|
||||||
|
|
||||||
env:
|
on: [push, pull_request]
|
||||||
YARN_INSTALL_NOPT: yarn add --ignore-platform --ignore-optional
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- v*
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
|
@ -17,75 +8,19 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-22.04]
|
os: [macos-latest, windows-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
submodules: "recursive"
|
|
||||||
|
|
||||||
- name: Install Node.js, NPM and Yarn
|
- name: Install Node.js, NPM and Yarn
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 12.16.3
|
||||||
cache: 'yarn'
|
|
||||||
|
|
||||||
- name: Install RPM & Pacman (on Ubuntu)
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
|
||||||
sudo apt-get update &&
|
|
||||||
sudo apt-get install --no-install-recommends -y rpm &&
|
|
||||||
sudo apt-get install --no-install-recommends -y libarchive-tools &&
|
|
||||||
sudo apt-get install --no-install-recommends -y libopenjp2-tools
|
|
||||||
|
|
||||||
- name: Install Snapcraft (on Ubuntu)
|
|
||||||
uses: samuelmeuli/action-snapcraft@v1
|
|
||||||
if: startsWith(matrix.os, 'ubuntu')
|
|
||||||
with:
|
|
||||||
snapcraft_token: ${{ secrets.snapcraft_token }}
|
|
||||||
|
|
||||||
- id: get_unm_version
|
|
||||||
name: Get the installed UNM version
|
|
||||||
run: |
|
|
||||||
yarn --ignore-optional
|
|
||||||
unm_version=$(node -e "console.log(require('./node_modules/@unblockneteasemusic/rust-napi/package.json').version)")
|
|
||||||
echo "::set-output name=unmver::${unm_version}"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install UNM dependencies for Windows
|
|
||||||
if: runner.os == 'Windows'
|
|
||||||
run: |
|
|
||||||
${{ env.YARN_INSTALL_NOPT }} \
|
|
||||||
@unblockneteasemusic/rust-napi-win32-x64-msvc@${{steps.get_unm_version.outputs.unmver}}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install UNM dependencies for macOS
|
|
||||||
if: runner.os == 'macOS'
|
|
||||||
run: |
|
|
||||||
${{ env.YARN_INSTALL_NOPT }} \
|
|
||||||
@unblockneteasemusic/rust-napi-darwin-x64@${{steps.get_unm_version.outputs.unmver}} \
|
|
||||||
@unblockneteasemusic/rust-napi-darwin-arm64@${{steps.get_unm_version.outputs.unmver}} \
|
|
||||||
dmg-license
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Install UNM dependencies for Linux
|
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
|
||||||
${{ env.YARN_INSTALL_NOPT }} \
|
|
||||||
@unblockneteasemusic/rust-napi-linux-x64-gnu@${{steps.get_unm_version.outputs.unmver}} \
|
|
||||||
@unblockneteasemusic/rust-napi-linux-arm64-gnu@${{steps.get_unm_version.outputs.unmver}} \
|
|
||||||
@unblockneteasemusic/rust-napi-linux-arm-gnueabihf@${{steps.get_unm_version.outputs.unmver}}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Build/release Electron app
|
- name: Build/release Electron app
|
||||||
uses: samuelmeuli/action-electron-builder@v1.6.0
|
uses: samuelmeuli/action-electron-builder@v1
|
||||||
env:
|
|
||||||
VUE_APP_NETEASE_API_URL: /api
|
|
||||||
VUE_APP_ELECTRON_API_URL: /api
|
|
||||||
VUE_APP_ELECTRON_API_URL_DEV: http://127.0.0.1:10754
|
|
||||||
VUE_APP_LASTFM_API_KEY: 09c55292403d961aa517ff7f5e8a3d9c
|
|
||||||
VUE_APP_LASTFM_API_SHARED_SECRET: 307c9fda32b3904e53654baff215cb67
|
|
||||||
with:
|
with:
|
||||||
# GitHub token, automatically provided to the action
|
# GitHub token, automatically provided to the action
|
||||||
# (No need to define this secret in the repo settings)
|
# (No need to define this secret in the repo settings)
|
||||||
|
|
@ -97,20 +32,14 @@ jobs:
|
||||||
|
|
||||||
use_vue_cli: true
|
use_vue_cli: true
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: YesPlayMusic-mac
|
name: YesPlayMusic-mac
|
||||||
path: dist_electron/*-universal.dmg
|
path: dist_electron/*.dmg
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: YesPlayMusic-win
|
name: YesPlayMusic-win
|
||||||
path: dist_electron/*Setup*.exe
|
path: dist_electron/*.exe
|
||||||
if-no-files-found: ignore
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: YesPlayMusic-linux
|
|
||||||
path: dist_electron/*.AppImage
|
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
|
||||||
48
.github/workflows/sync.yml
vendored
|
|
@ -1,48 +0,0 @@
|
||||||
name: Upstream Sync
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
issues: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 * * * *' # every hour
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync_latest_from_upstream:
|
|
||||||
name: Sync latest commits from upstream repo
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ github.event.repository.fork }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Clean issue notice
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'close-issues'
|
|
||||||
labels: '🚨 Sync Fail'
|
|
||||||
|
|
||||||
- name: Sync upstream changes
|
|
||||||
id: sync
|
|
||||||
uses: aormsby/Fork-Sync-With-Upstream-action@v3.4
|
|
||||||
with:
|
|
||||||
upstream_sync_repo: qier222/YesPlayMusic
|
|
||||||
upstream_sync_branch: master
|
|
||||||
target_sync_branch: master
|
|
||||||
target_repo_token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, no need to set
|
|
||||||
test_mode: false
|
|
||||||
|
|
||||||
- name: Sync check
|
|
||||||
if: failure()
|
|
||||||
uses: actions-cool/issues-helper@v3
|
|
||||||
with:
|
|
||||||
actions: 'create-issue'
|
|
||||||
title: '🚨 同步失败 | Sync Fail'
|
|
||||||
labels: '🚨 Sync Fail'
|
|
||||||
body: |
|
|
||||||
Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork.
|
|
||||||
|
|
||||||
由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次。
|
|
||||||
15
.gitignore
vendored
|
|
@ -1,6 +1,8 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
/dist
|
/dist
|
||||||
|
dist_electron
|
||||||
|
Icon?
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env
|
.env
|
||||||
|
|
@ -28,16 +30,3 @@ pnpm-debug.log*
|
||||||
/dist_electron
|
/dist_electron
|
||||||
NeteaseCloudMusicApi-master
|
NeteaseCloudMusicApi-master
|
||||||
NeteaseCloudMusicApi-master.zip
|
NeteaseCloudMusicApi-master.zip
|
||||||
|
|
||||||
# Local Netlify folder
|
|
||||||
.netlify
|
|
||||||
vercel.json
|
|
||||||
# Devenv
|
|
||||||
.devenv*
|
|
||||||
devenv.local.nix
|
|
||||||
|
|
||||||
# direnv
|
|
||||||
.direnv
|
|
||||||
|
|
||||||
# pre-commit
|
|
||||||
.pre-commit-config.yaml
|
|
||||||
|
|
|
||||||
4
.npmrc
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# 如果发现 npm / yarn 安装太慢,可以解除注释
|
||||||
|
# registry=https://registry.npm.taobao.org/
|
||||||
|
# ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron
|
||||||
|
# phantomjs_cdnurl=https://npm.taobao.org/dist/phantomjs
|
||||||
1
.nvmrc
|
|
@ -1 +0,0 @@
|
||||||
14
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
build
|
build
|
||||||
coverage
|
coverage
|
||||||
dist
|
dist
|
||||||
|
netease_api
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"useTabs": false,
|
"useTabs": false,
|
||||||
"semi": true,
|
"semi": true,
|
||||||
"singleQuote": true,
|
"singleQuote": false,
|
||||||
"jsxSingleQuote": true,
|
"jsxSingleQuote": true,
|
||||||
"arrowParens": "avoid",
|
"jsxBracketSameLine": false,
|
||||||
|
"arrowParens": "always",
|
||||||
"endOfLine": "lf",
|
"endOfLine": "lf",
|
||||||
"bracketSpacing": true,
|
"bracketSpacing": true,
|
||||||
"htmlWhitespaceSensitivity": "strict"
|
"htmlWhitespaceSensitivity": "strict"
|
||||||
|
|
|
||||||
25
Dockerfile
|
|
@ -1,25 +0,0 @@
|
||||||
FROM node:16.13.1-alpine as build
|
|
||||||
ENV VUE_APP_NETEASE_API_URL=/api
|
|
||||||
WORKDIR /app
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
|
||||||
apk add --no-cache python3 make g++ git
|
|
||||||
COPY package.json yarn.lock ./
|
|
||||||
RUN yarn install
|
|
||||||
COPY . .
|
|
||||||
RUN yarn config set electron_mirror https://npmmirror.com/mirrors/electron/ && \
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
FROM nginx:1.20.2-alpine as app
|
|
||||||
|
|
||||||
COPY --from=build /app/package.json /usr/local/lib/
|
|
||||||
|
|
||||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories &&\
|
|
||||||
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main libuv \
|
|
||||||
&& apk add --no-cache --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.14/main nodejs npm \
|
|
||||||
&& npm i -g $(awk -F \" '{if($2=="NeteaseCloudMusicApi") print $2"@"$4}' /usr/local/lib/package.json) \
|
|
||||||
&& rm -f /usr/local/lib/package.json
|
|
||||||
|
|
||||||
COPY --from=build /app/docker/nginx.conf.example /etc/nginx/conf.d/default.conf
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
|
|
||||||
CMD nginx ; exec npx NeteaseCloudMusicApi
|
|
||||||
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2023 qier222
|
Copyright (c) 2020 qier222
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
212
README.md
|
|
@ -8,221 +8,68 @@
|
||||||
<p align="center">
|
<p align="center">
|
||||||
高颜值的第三方网易云播放器
|
高颜值的第三方网易云播放器
|
||||||
<br />
|
<br />
|
||||||
<a href="https://music.ineko.cc" target="blank"><strong>🌎 访问DEMO</strong></a> |
|
<a href="https://music.qier222.com" target="blank"><strong>🌎 访问DEMO</strong></a> |
|
||||||
<a href="#%EF%B8%8F-安装" target="blank"><strong>📦️ 下载安装包</strong></a> |
|
<a href="#%EF%B8%8F-安装" target="blank"><strong>📦️ 下载安装包</strong></a>
|
||||||
<a href="https://t.me/yesplaymusic" target="blank"><strong>💬 加入交流群</strong></a>
|
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
</p>
|
</p>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
[![Library][library-screenshot]](https://music.ineko.cc)
|
[![Library][library-screenshot]](https://music.qier222.com)
|
||||||
|
|
||||||
|
|
||||||
## 全新版本
|
|
||||||
全新2.0 Alpha测试版已发布,欢迎前往 [Releases](https://github.com/qier222/YesPlayMusic/releases) 页面下载。
|
|
||||||
当前版本将会进入维护模式,除重大bug修复外,不会再更新新功能。
|
|
||||||
|
|
||||||
## ✨ 特性
|
## ✨ 特性
|
||||||
|
|
||||||
- ✅ 使用 Vue.js 全家桶开发
|
- ✅ 使用 Vue.js 全家桶开发
|
||||||
- 🔴 网易云账号登录(扫码/手机/邮箱登录)
|
- 🔴 网易云账号登录
|
||||||
- 📺 支持 MV 播放
|
- 📺 MV 播放
|
||||||
- 📃 支持歌词显示
|
- 📃 支持歌词显示
|
||||||
- 📻 支持私人 FM / 每日推荐歌曲
|
|
||||||
- 🚫🤝 无任何社交功能
|
- 🚫🤝 无任何社交功能
|
||||||
- 🌎️ 海外用户可直接播放(需要登录网易云账号)
|
- 🌎️ 海外用户可直接播放(需要登录网易云账号)
|
||||||
- 🔐 支持 [UnblockNeteaseMusic](https://github.com/UnblockNeteaseMusic/server#音源清单),自动使用[各类音源](https://github.com/UnblockNeteaseMusic/server#音源清单)替换变灰歌曲链接 (网页版不支持)
|
- 🔐 支持 [UnblockNeteaseMusic](https://github.com/nondanee/UnblockNeteaseMusic),自动使用 QQ/酷狗/酷我音源替换变灰歌曲链接 (网页版不支持)
|
||||||
- 「各类音源」指默认启用的音源。
|
- ⏭️ 支持 MediaSession API,可以使用系统快捷键操作上一首下一首
|
||||||
- YouTube 音源需自行安装 `yt-dlp`。
|
|
||||||
- ✔️ 每日自动签到(手机端和电脑端同时签到)
|
- ✔️ 每日自动签到(手机端和电脑端同时签到)
|
||||||
- 🌚 Light/Dark Mode 自动切换
|
- 🌚 Light/Dark Mode 自动切换
|
||||||
- 👆 支持 Touch Bar
|
- 👆 支持 Touch Bar
|
||||||
- 🖥️ 支持 PWA,可在 Chrome/Edge 里点击地址栏右边的 ➕ 安装到电脑
|
- 🖥️ 支持 PWA,可在 Chrome/Edge 里点击地址栏右边的 ➕ 安装到电脑
|
||||||
- 🟥 支持 Last.fm Scrobble
|
- 🙉 支持显示歌曲和专辑的 Explicit 标志
|
||||||
- ☁️ 支持音乐云盘
|
|
||||||
- ⌨️ 自定义快捷键和全局快捷键
|
|
||||||
- 🎧 支持 Mpris
|
|
||||||
- 🛠 更多特性开发中
|
- 🛠 更多特性开发中
|
||||||
|
|
||||||
## 📦️ 安装
|
## 📦️ 安装
|
||||||
|
|
||||||
Electron 版本由 [@hawtim](https://github.com/hawtim) 和 [@qier222](https://github.com/qier222) 适配并维护,支持 macOS、Windows、Linux。
|
Electron 版本由 [@hawtim](https://github.com/hawtim) 和 [@qier222](https://github.com/qier222) 适配并维护,支持 macOS、Windows、Linux。
|
||||||
|
|
||||||
访问本项目的 [Releases](https://github.com/qier222/YesPlayMusic/releases)
|
访问本项目的 [Releases](https://github.com/qier222/YesPlayMusic/releases) 页面下载安装包,或者访问 [镜像下载站 (大陆访问更快)](https://dl.qier222.com/YesPlayMusic/) 下载。
|
||||||
页面下载安装包。
|
|
||||||
|
|
||||||
- macOS 用户可以通过 Homebrew 来安装:`brew install --cask yesplaymusic`
|
## ⚙️ 部署至服务器
|
||||||
|
|
||||||
- Windows 用户可以通过 Scoop 来安装:`scoop install extras/yesplaymusic`
|
除了下载安装包使用,你还可以将本项目部署到你的服务器上。
|
||||||
|
|
||||||
## ⚙️ 部署至 Vercel
|
|
||||||
|
|
||||||
除了下载安装包使用,你还可以将本项目部署到 Vercel 或你的服务器上。下面是部署到 Vercel 的方法。
|
|
||||||
|
|
||||||
本项目的 Demo (https://music.qier222.com) 就是部署在 Vercel 上的网站。
|
|
||||||
|
|
||||||
[](https://vercel.com/?utm_source=ohmusic&utm_campaign=oss)
|
|
||||||
|
|
||||||
1. 部署网易云 API,详情参见 [Binaryify/NeteaseCloudMusicApi](https://neteasecloudmusicapi.vercel.app/#/?id=%e5%ae%89%e8%a3%85)
|
|
||||||
。你也可以将 API 部署到 Vercel。
|
|
||||||
|
|
||||||
2. 点击本仓库右上角的 Fork,复制本仓库到你的 GitHub 账号。
|
|
||||||
|
|
||||||
3. 点击仓库的 Add File,选择 Create new file,输入 `vercel.json`,将下面的内容复制粘贴到文件中,并将 `https://your-netease-api.example.com` 替换为你刚刚部署的网易云 API 地址:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"rewrites": [
|
|
||||||
{
|
|
||||||
"source": "/api/:match*",
|
|
||||||
"destination": "https://your-netease-api.example.com/:match*"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
4. 打开 [Vercel.com](https://vercel.com),使用 GitHub 登录。
|
|
||||||
|
|
||||||
5. 点击 Import Git Repository 并选择你刚刚复制的仓库并点击 Import。
|
|
||||||
|
|
||||||
6. 点击 PERSONAL ACCOUNT 旁边的 Select。
|
|
||||||
|
|
||||||
7. 点击 Environment Variables,填写 Name 为 `VUE_APP_NETEASE_API_URL`,Value 为 `/api`,点击 Add。最后点击底部的 Deploy 就可以部署到
|
|
||||||
Vercel 了。
|
|
||||||
|
|
||||||
## ⚙️ 部署到自己的服务器
|
|
||||||
|
|
||||||
除了部署到 Vercel,你还可以部署到自己的服务器上
|
|
||||||
|
|
||||||
1. 部署网易云 API,详情参见 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)
|
1. 部署网易云 API,详情参见 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)
|
||||||
2. 克隆本仓库
|
2. 克隆本仓库
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone --recursive https://github.com/qier222/YesPlayMusic.git
|
git clone https://github.com/qier222/YesPlayMusic.git
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 安装依赖
|
3. 安装依赖
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
yarn install
|
yarn install
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
4. (可选)使用 Nginx 反向代理 API,将 API 路径映射为 `/api`,如果 API 和网页不在同一个域名下的话(跨域),会有一些 bug。
|
4. 复制 `/.env.example` 文件为 `/.env`,修改里面 `VUE_APP_NETEASE_API_URL` 的值为网易云 API 地址。本地开发的话可以填写 API 地址为 `http://localhost:3000`,YesPlayMusic 地址为 `http://localhost:8080`
|
||||||
|
|
||||||
5. 复制 `/.env.example` 文件为 `/.env`,修改里面 `VUE_APP_NETEASE_API_URL` 的值为网易云 API 地址。本地开发的话可以填写 API 地址为 `http://localhost:3000`,YesPlayMusic 地址为 `http://localhost:8080`。如果你使用了反向代理 API,可以填写 API 地址为 `/api`。
|
|
||||||
|
|
||||||
```
|
```
|
||||||
VUE_APP_NETEASE_API_URL=http://localhost:3000
|
VUE_APP_NETEASE_API_URL=http://localhost:3000
|
||||||
```
|
```
|
||||||
|
|
||||||
6. 编译打包
|
5. 编译打包
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
yarn run build
|
yarn run build
|
||||||
```
|
```
|
||||||
|
|
||||||
7. 将 `/dist` 目录下的文件上传到你的 Web 服务器
|
6. 将 `/dist` 目录下的文件上传到你的 Web 服务器
|
||||||
|
|
||||||
## ⚙️ 宝塔面板 docker应用商店 部署
|
|
||||||
|
|
||||||
1. 安装宝塔面板,前往[宝塔面板官网](https://www.bt.cn/new/download.html) ,选择正式版的脚本下载安装。
|
|
||||||
|
|
||||||
2. 安装后登录宝塔面板,在左侧导航栏中点击 Docker,首次进入会提示安装Docker服务,点击立即安装,按提示完成安装
|
|
||||||
|
|
||||||
3. 安装完成后在应用商店中找到YesPlayMusic,点击安装,配置域名、端口等基本信息即可完成安装。
|
|
||||||
|
|
||||||
4. 安装后在浏览器输入上一步骤设置的域名即可访问。
|
|
||||||
|
|
||||||
## ⚙️ Docker 部署
|
|
||||||
|
|
||||||
1. 构建 Docker Image
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker build -t yesplaymusic .
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 启动 Docker Container
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker run -d --name YesPlayMusic -p 80:80 yesplaymusic
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Docker Compose 启动
|
|
||||||
|
|
||||||
```sh
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
|
|
||||||
YesPlayMusic 地址为 `http://localhost`
|
|
||||||
|
|
||||||
## ⚙️ 部署至 Replit
|
|
||||||
|
|
||||||
1. 新建 Repl,选择 Bash 模板
|
|
||||||
|
|
||||||
2. 在 Replit shell 中运行以下命令
|
|
||||||
|
|
||||||
```sh
|
|
||||||
bash <(curl -s -L https://raw.githubusercontent.com/qier222/YesPlayMusic/main/install-replit.sh)
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 首次运行成功后,只需点击绿色按钮 `Run` 即可再次运行
|
|
||||||
|
|
||||||
4. 由于 replit 个人版限制内存为 1G(教育版为 3G),构建过程中可能会失败,请再次运行上述命令或运行以下命令:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd /home/runner/${REPL_SLUG}/music && yarn install && yarn run build
|
|
||||||
```
|
|
||||||
|
|
||||||
## 👷♂️ 打包客户端
|
|
||||||
|
|
||||||
如果在 Release 页面没有找到适合你的设备的安装包的话,你可以根据下面的步骤来打包自己的客户端。
|
|
||||||
|
|
||||||
1. 打包 Electron 需要用到 Node.js 和 Yarn。可前往 [Node.js 官网](https://nodejs.org/zh-cn/) 下载安装包。安装 Node.js
|
|
||||||
后可在终端里执行 `npm install -g yarn` 来安装 Yarn。
|
|
||||||
|
|
||||||
2. 使用 `git clone --recursive https://github.com/qier222/YesPlayMusic.git` 克隆本仓库到本地。
|
|
||||||
|
|
||||||
3. 使用 `yarn install` 安装项目依赖。
|
|
||||||
|
|
||||||
4. 复制 `/.env.example` 文件为 `/.env` 。
|
|
||||||
|
|
||||||
5. 选择下列表格的命令来打包适合的你的安装包,打包出来的文件在 `/dist_electron` 目录下。了解更多信息可访问 [electron-builder 文档](https://www.electron.build/cli)
|
|
||||||
|
|
||||||
| 命令 | 说明 |
|
|
||||||
| ------------------------------------------ | ------------------------- |
|
|
||||||
| `yarn electron:build --windows nsis:ia32` | Windows 32 位 |
|
|
||||||
| `yarn electron:build --windows nsis:arm64` | Windows ARM |
|
|
||||||
| `yarn electron:build --linux deb:armv7l` | Debian armv7l(树莓派等) |
|
|
||||||
| `yarn electron:build --macos dir:arm64` | macOS ARM |
|
|
||||||
|
|
||||||
## :computer: 配置开发环境
|
|
||||||
|
|
||||||
本项目由 [NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi) 提供 API。
|
|
||||||
|
|
||||||
运行本项目
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# 安装依赖
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# 创建本地环境变量
|
|
||||||
cp .env.example .env
|
|
||||||
|
|
||||||
# 运行(网页端)
|
|
||||||
yarn serve
|
|
||||||
|
|
||||||
# 运行(electron)
|
|
||||||
yarn electron:serve
|
|
||||||
```
|
|
||||||
|
|
||||||
本地运行 NeteaseCloudMusicApi,或者将 API [部署至 Vercel](#%EF%B8%8F-部署至-vercel)
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# 运行 API (默认 3000 端口)
|
|
||||||
yarn netease_api:run
|
|
||||||
```
|
|
||||||
|
|
||||||
## ☑️ Todo
|
## ☑️ Todo
|
||||||
|
|
||||||
|
|
@ -232,29 +79,16 @@ yarn netease_api:run
|
||||||
|
|
||||||
## 📜 开源许可
|
## 📜 开源许可
|
||||||
|
|
||||||
本项目仅供个人学习研究使用,禁止用于商业及非法用途。
|
|
||||||
|
|
||||||
基于 [MIT license](https://opensource.org/licenses/MIT) 许可进行开源。
|
基于 [MIT license](https://opensource.org/licenses/MIT) 许可进行开源。
|
||||||
|
|
||||||
## 灵感来源
|
|
||||||
|
|
||||||
API 源代码来自 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)
|
|
||||||
|
|
||||||
- [Apple Music](https://music.apple.com)
|
|
||||||
- [YouTube Music](https://music.youtube.com)
|
|
||||||
- [Spotify](https://www.spotify.com)
|
|
||||||
- [网易云音乐](https://music.163.com)
|
|
||||||
|
|
||||||
## 🖼️ 截图
|
## 🖼️ 截图
|
||||||
|
|
||||||
![lyrics][lyrics-screenshot]
|
[![artist][artist-screenshot]](https://music.qier222.com)
|
||||||
![library-dark][library-dark-screenshot]
|
[![album][album-screenshot]](https://music.qier222.com)
|
||||||
![album][album-screenshot]
|
[![playlist][playlist-screenshot]](https://music.qier222.com)
|
||||||
![home-2][home-2-screenshot]
|
[![explore][explore-screenshot]](https://music.qier222.com)
|
||||||
![artist][artist-screenshot]
|
[![search][search-screenshot]](https://music.qier222.com)
|
||||||
![search][search-screenshot]
|
[![home][home-screenshot]](https://music.qier222.com)
|
||||||
![home][home-screenshot]
|
|
||||||
![explore][explore-screenshot]
|
|
||||||
|
|
||||||
<!-- MARKDOWN LINKS & IMAGES -->
|
<!-- MARKDOWN LINKS & IMAGES -->
|
||||||
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
||||||
|
|
@ -263,8 +97,6 @@ API 源代码来自 [Binaryify/NeteaseCloudMusicApi](https://github.com/Binaryif
|
||||||
[artist-screenshot]: images/artist.png
|
[artist-screenshot]: images/artist.png
|
||||||
[explore-screenshot]: images/explore.png
|
[explore-screenshot]: images/explore.png
|
||||||
[home-screenshot]: images/home.png
|
[home-screenshot]: images/home.png
|
||||||
[home-2-screenshot]: images/home-2.png
|
|
||||||
[lyrics-screenshot]: images/lyrics.png
|
|
||||||
[library-screenshot]: images/library.png
|
[library-screenshot]: images/library.png
|
||||||
[library-dark-screenshot]: images/library-dark.png
|
[playlist-screenshot]: images/playlist.png
|
||||||
[search-screenshot]: images/search.png
|
[search-screenshot]: images/search.png
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [
|
presets: ["@vue/cli-plugin-babel/preset"],
|
||||||
[
|
plugins: [
|
||||||
'@vue/cli-plugin-babel/preset',
|
"@babel/plugin-proposal-nullish-coalescing-operator",
|
||||||
{
|
"@babel/plugin-proposal-optional-chaining",
|
||||||
useBuiltIns: 'usage',
|
|
||||||
shippedProposals: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
||||||
132
devenv.lock
|
|
@ -1,132 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"devenv": {
|
|
||||||
"locked": {
|
|
||||||
"dir": "src/modules",
|
|
||||||
"lastModified": 1730412360,
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"rev": "45847cb1f14a6d8cfa86ea943703c54a8798ae7e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"dir": "src/modules",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1696426674,
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"pre-commit-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730272153,
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixpkgs-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs-stable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730327045,
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "080166c15633801df010977d9d7474b4a6c549d7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-24.05",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nodejs16": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1700230496,
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "a71323f68d4377d12c04a5410e214495ec598d4c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "a71323f68d4377d12c04a5410e214495ec598d4c",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1730302582,
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "af8a16fe5c264f5e9e18bcee2859b40a656876cf",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"devenv": "devenv",
|
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"nodejs16": "nodejs16",
|
|
||||||
"pre-commit-hooks": "pre-commit-hooks"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
53
devenv.nix
|
|
@ -1,53 +0,0 @@
|
||||||
{ pkgs, lib, config, inputs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
nodejs16 = import inputs.nodejs16 { system = pkgs.stdenv.system; };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# https://devenv.sh/basics/
|
|
||||||
env.GREET = "devenv";
|
|
||||||
|
|
||||||
# https://devenv.sh/packages/
|
|
||||||
packages = [ pkgs.git ] ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
|
|
||||||
frameworks.AppKit
|
|
||||||
]);
|
|
||||||
|
|
||||||
# https://devenv.sh/languages/
|
|
||||||
languages.javascript.enable = true;
|
|
||||||
languages.javascript.package = nodejs16.pkgs.nodejs_16;
|
|
||||||
languages.javascript.corepack.enable = true;
|
|
||||||
# languages.rust.enable = true;
|
|
||||||
|
|
||||||
# https://devenv.sh/processes/
|
|
||||||
# processes.cargo-watch.exec = "cargo-watch";
|
|
||||||
|
|
||||||
# https://devenv.sh/services/
|
|
||||||
# services.postgres.enable = true;
|
|
||||||
|
|
||||||
# https://devenv.sh/scripts/
|
|
||||||
scripts.hello.exec = ''
|
|
||||||
echo hello from $GREET
|
|
||||||
'';
|
|
||||||
|
|
||||||
enterShell = ''
|
|
||||||
hello
|
|
||||||
git --version
|
|
||||||
'';
|
|
||||||
|
|
||||||
# https://devenv.sh/tasks/
|
|
||||||
# tasks = {
|
|
||||||
# "myproj:setup".exec = "mytool build";
|
|
||||||
# "devenv:enterShell".after = [ "myproj:setup" ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# https://devenv.sh/tests/
|
|
||||||
enterTest = ''
|
|
||||||
echo "Running tests"
|
|
||||||
git --version | grep --color=auto "${pkgs.git.version}"
|
|
||||||
'';
|
|
||||||
|
|
||||||
# https://devenv.sh/pre-commit-hooks/
|
|
||||||
# pre-commit.hooks.shellcheck.enable = true;
|
|
||||||
|
|
||||||
# See full reference at https://devenv.sh/reference/options/
|
|
||||||
}
|
|
||||||
19
devenv.yaml
|
|
@ -1,19 +0,0 @@
|
||||||
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
|
|
||||||
inputs:
|
|
||||||
nixpkgs:
|
|
||||||
url: github:nixos/nixpkgs/nixpkgs-unstable
|
|
||||||
nodejs16:
|
|
||||||
url: github:nixos/nixpkgs/a71323f68d4377d12c04a5410e214495ec598d4c
|
|
||||||
|
|
||||||
# https://github.com/cachix/devenv/issues/792#issuecomment-2043166453
|
|
||||||
impure: true
|
|
||||||
# If you're using non-OSS software, you can set allowUnfree to true.
|
|
||||||
# allowUnfree: true
|
|
||||||
|
|
||||||
# If you're willing to use a package that's vulnerable
|
|
||||||
# permittedInsecurePackages:
|
|
||||||
# - "openssl-1.1.1w"
|
|
||||||
|
|
||||||
# If you have more than one devenv you can merge them
|
|
||||||
#imports:
|
|
||||||
# - ./backend
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
services:
|
|
||||||
YesPlayMusic:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
image: yesplaymusic
|
|
||||||
container_name: YesPlayMusic
|
|
||||||
volumes:
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
- /etc/timezone:/etc/timezone:ro
|
|
||||||
- ./docker/nginx.conf.example:/etc/nginx/conf.d/default.conf:ro
|
|
||||||
ports:
|
|
||||||
- 80:80
|
|
||||||
restart: always
|
|
||||||
depends_on:
|
|
||||||
- UnblockNeteaseMusic
|
|
||||||
environment:
|
|
||||||
- NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
||||||
networks:
|
|
||||||
my_network:
|
|
||||||
|
|
||||||
UnblockNeteaseMusic:
|
|
||||||
image: pan93412/unblock-netease-music-enhanced
|
|
||||||
command: -o kugou kuwo migu bilibili pyncmd -p 80:443 -f 45.127.129.53 -e -
|
|
||||||
# environment:
|
|
||||||
# JSON_LOG: true
|
|
||||||
# LOG_LEVEL: debug
|
|
||||||
networks:
|
|
||||||
my_network:
|
|
||||||
aliases:
|
|
||||||
- music.163.com
|
|
||||||
- interface.music.163.com
|
|
||||||
- interface3.music.163.com
|
|
||||||
- interface.music.163.com.163jiasu.com
|
|
||||||
- interface3.music.163.com.163jiasu.com
|
|
||||||
restart: always
|
|
||||||
|
|
||||||
networks:
|
|
||||||
my_network:
|
|
||||||
driver: bridge
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
server {
|
|
||||||
gzip on;
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location @rewrites {
|
|
||||||
rewrite ^(.*)$ /index.html last;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_buffers 16 32k;
|
|
||||||
proxy_buffer_size 128k;
|
|
||||||
proxy_busy_buffers_size 128k;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
|
||||||
proxy_set_header X-NginX-Proxy true;
|
|
||||||
proxy_pass http://localhost:3000/;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BIN
images/album.png
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 804 KiB |
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 730 KiB |
|
Before Width: | Height: | Size: 354 KiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 312 KiB |
BIN
images/home.png
|
Before Width: | Height: | Size: 389 KiB After Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 335 KiB |
|
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 339 KiB |
BIN
images/playlist.png
Normal file
|
After Width: | Height: | Size: 1 MiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 1 MiB |
|
|
@ -1,28 +0,0 @@
|
||||||
#!/usr/bin/bash
|
|
||||||
|
|
||||||
# 初始化 .replit 和 replit.nix
|
|
||||||
if [[ $1 == i ]];then
|
|
||||||
echo -e 'run = ["bash", "main.sh"]\n\nentrypoint = "main.sh"' >.replit
|
|
||||||
echo -e "{ pkgs }: {\n\t\tdeps = [\n\t\t\tpkgs.nodejs-16_x\n\t\t\tpkgs.yarn\n\t\t\tpkgs.bashInteractive\n\t\t];\n}" > replit.nix
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 安装
|
|
||||||
if [[ ! -d api ]];then
|
|
||||||
mkdir api
|
|
||||||
git clone https://github.com/Binaryify/NeteaseCloudMusicApi ./api && \
|
|
||||||
cd api && npm install && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d music ]];then
|
|
||||||
mkdir music
|
|
||||||
git clone https://github.com/qier222/YesPlayMusic ./music && \
|
|
||||||
cd music && cp .env.example .env && npm install --force && npm run build && cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 启动
|
|
||||||
PID=`ps -ef | grep npm | awk '{print $2}' | sed '$d'`
|
|
||||||
|
|
||||||
if [[ ! -z ${PID} ]];then echo $PID | xargs kill;fi
|
|
||||||
nohup bash -c 'cd api && PORT=35216 node app.js' > api.log 2>&1
|
|
||||||
nohup bash -c 'npx serve music/dist/' > music.log 2>&1
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
},
|
},
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true
|
||||||
"jsx": "preserve"
|
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
"exclude": ["node_modules"]
|
"exclude": ["node_modules"]
|
||||||
|
|
|
||||||
34
netease_api/.editorconfig
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
# EditorConfig is awesome: http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# Matches multiple files with brace expansion notation
|
||||||
|
# Set default charset
|
||||||
|
[*.{js,py}]
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
|
# 4 space indentation
|
||||||
|
[*.py]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
# Tab indentation (no size specified)
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
|
||||||
|
# Indentation override for all JS under lib directory
|
||||||
|
[*.{js,ts}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Matches the exact files either package.json or .travis.yml
|
||||||
|
[{package.json,.travis.yml}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
49
netease_api/.eslintrc.js
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parserOptions: {
|
||||||
|
parser: 'babel-eslint',
|
||||||
|
ecmaVersion: 2018,
|
||||||
|
sourceType: 'module',
|
||||||
|
},
|
||||||
|
plugins: ['html'],
|
||||||
|
extends: ['plugin:prettier/recommended'],
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
node: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
rules: {
|
||||||
|
indent: ['error', 2, { SwitchCase: 1 }],
|
||||||
|
'space-infix-ops': ['error', { int32Hint: false }],
|
||||||
|
'key-spacing': [
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
beforeColon: false,
|
||||||
|
afterColon: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'no-octal': 2,
|
||||||
|
'no-redeclare': 2,
|
||||||
|
'comma-spacing': 2,
|
||||||
|
'no-new-object': 2,
|
||||||
|
'arrow-spacing': 2,
|
||||||
|
quotes: [
|
||||||
|
2,
|
||||||
|
'single',
|
||||||
|
{
|
||||||
|
avoidEscape: true,
|
||||||
|
allowTemplateLiterals: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
files: ['**/*.ts'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
extends: [
|
||||||
|
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
|
||||||
|
'prettier/@typescript-eslint',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
5
netease_api/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
*.log
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
3
netease_api/.npmignore
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
static
|
||||||
|
docs
|
||||||
|
node_modules
|
||||||
5
netease_api/.prettierrc
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"semi": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"singleQuote": true
|
||||||
|
}
|
||||||
312
netease_api/README.MD
Normal file
|
|
@ -0,0 +1,312 @@
|
||||||
|
# 网易云音乐 API
|
||||||
|
|
||||||
|
网易云音乐 Node.js API service
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://www.npmjs.com/package/NeteaseCloudMusicApi"><img src="https://img.shields.io/npm/v/NeteaseCloudMusicApi.svg" alt="Version"></a>
|
||||||
|
<a href="https://www.npmjs.com/package/NeteaseCloudMusicApi"><img src="https://img.shields.io/npm/l/NeteaseCloudMusicApi.svg" alt="License"></a>
|
||||||
|
<a href="https://www.npmjs.com/package/NeteaseCloudMusicApi"><img src="https://img.shields.io/david/dev/binaryify/NeteaseCloudMusicApi.svg" alt="devDependencies" ></a>
|
||||||
|
<a href="https://www.npmjs.com/package/NeteaseCloudMusicApi"><img src="https://img.shields.io/david/binaryify/NeteaseCloudMusicApi.svg" alt="devDependencies" ></a>
|
||||||
|
<a href="https://codeclimate.com/github/Binaryify/NeteaseCloudMusicApi"><img src="https://codeclimate.com/github/Binaryify/NeteaseCloudMusicApi/badges/gpa.svg" /></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
## 灵感来自
|
||||||
|
|
||||||
|
[disoul/electron-cloud-music](https://github.com/disoul/electron-cloud-music)
|
||||||
|
|
||||||
|
[darknessomi/musicbox](https://github.com/darknessomi/musicbox)
|
||||||
|
|
||||||
|
[sqaiyan/netmusic-node](https://github.com/sqaiyan/netmusic-node)
|
||||||
|
|
||||||
|
|
||||||
|
## 环境要求
|
||||||
|
|
||||||
|
需要 NodeJS 8.12+ 环境
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
```shell
|
||||||
|
|
||||||
|
$ git clone git@github.com:Binaryify/NeteaseCloudMusicApi.git
|
||||||
|
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
或者
|
||||||
|
```shell
|
||||||
|
$ git clone https://github.com/Binaryify/NeteaseCloudMusicApi.git
|
||||||
|
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## 运行
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
服务器启动默认端口为 3000,若不想使用 3000 端口,可使用以下命令: Mac/Linux
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ PORT=4000 node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
windows 下使用 git-bash 或者 cmder 等终端执行以下命令:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ set PORT=4000 && node app.js
|
||||||
|
```
|
||||||
|
|
||||||
|
## 可以在Node.js调用
|
||||||
|
v3.31.0后支持Node.js调用,导入的方法为`module`内的文件名,返回内容包含`status`和`body`,`status`为状态码,`body`为请求返回内容,参考`module_example` 文件夹下的 `test.js`
|
||||||
|
```js
|
||||||
|
const { login_cellphone, user_cloud } = require('NeteaseCloudMusicApi')
|
||||||
|
async function main() {
|
||||||
|
try {
|
||||||
|
const result = await login_cellphone({
|
||||||
|
phone: '手机号',
|
||||||
|
password: '密码'
|
||||||
|
})
|
||||||
|
console.log(result)
|
||||||
|
const result2 = await user_cloud({
|
||||||
|
cookie: result.body.cookie // 凭证
|
||||||
|
})
|
||||||
|
console.log(result2.body)
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
main()
|
||||||
|
```
|
||||||
|
|
||||||
|
## 支持 TypeScript
|
||||||
|
```ts
|
||||||
|
// test.ts
|
||||||
|
import { banner } from 'NeteaseCloudMusicApi'
|
||||||
|
banner({ type:0 }).then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## 使用文档
|
||||||
|
|
||||||
|
[文档地址](https://binaryify.github.io/NeteaseCloudMusicApi)
|
||||||
|
|
||||||
|
[文档地址2](https://neteasecloudmusicapi.vercel.app)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## 功能特性
|
||||||
|
1. 登录
|
||||||
|
2. 刷新登录
|
||||||
|
3. 发送验证码
|
||||||
|
4. 校验验证码
|
||||||
|
5. 注册(修改密码)
|
||||||
|
6. 获取用户信息 , 歌单,收藏,mv, dj 数量
|
||||||
|
7. 获取用户歌单
|
||||||
|
8. 获取用户电台
|
||||||
|
9. 获取用户关注列表
|
||||||
|
10. 获取用户粉丝列表
|
||||||
|
11. 获取用户动态
|
||||||
|
12. 获取用户播放记录
|
||||||
|
13. 获取精品歌单
|
||||||
|
14. 获取歌单详情
|
||||||
|
15. 搜索
|
||||||
|
16. 搜索建议
|
||||||
|
17. 获取歌词
|
||||||
|
18. 歌曲评论
|
||||||
|
19. 收藏单曲到歌单
|
||||||
|
20. 专辑评论
|
||||||
|
21. 歌单评论
|
||||||
|
22. mv 评论
|
||||||
|
23. 电台节目评论
|
||||||
|
24. banner
|
||||||
|
25. 获取歌曲详情
|
||||||
|
26. 获取专辑内容
|
||||||
|
27. 获取歌手单曲
|
||||||
|
28. 获取歌手 mv
|
||||||
|
29. 获取歌手专辑
|
||||||
|
30. 获取歌手描述
|
||||||
|
31. 获取相似歌手
|
||||||
|
32. 获取相似歌单
|
||||||
|
33. 相似 mv
|
||||||
|
34. 获取相似音乐
|
||||||
|
35. 获取最近 5 个听了这首歌的用户
|
||||||
|
36. 获取每日推荐歌单
|
||||||
|
37. 获取每日推荐歌曲
|
||||||
|
38. 私人 FM
|
||||||
|
39. 签到
|
||||||
|
40. 喜欢音乐
|
||||||
|
41. 垃圾桶
|
||||||
|
42. 歌单 ( 网友精选碟 )
|
||||||
|
43. 新碟上架
|
||||||
|
44. 热门歌手
|
||||||
|
45. 最新 mv
|
||||||
|
46. 推荐 mv
|
||||||
|
47. 推荐歌单
|
||||||
|
48. 推荐新音乐
|
||||||
|
49. 推荐电台
|
||||||
|
50. 推荐节目
|
||||||
|
51. 独家放送
|
||||||
|
52. mv 排行
|
||||||
|
53. 获取 mv 数据
|
||||||
|
54. 播放 mv/视频
|
||||||
|
55. 排行榜
|
||||||
|
56. 歌手榜
|
||||||
|
57. 云盘
|
||||||
|
58. 电台 - 推荐
|
||||||
|
59. 电台 - 分类
|
||||||
|
60. 电台 - 分类推荐
|
||||||
|
61. 电台 - 订阅
|
||||||
|
62. 电台 - 详情
|
||||||
|
63. 电台 - 节目
|
||||||
|
64. 给评论点赞
|
||||||
|
65. 获取动态
|
||||||
|
66. 热搜列表(简略)
|
||||||
|
67. 发送私信
|
||||||
|
68. 发送私信歌单
|
||||||
|
69. 新建歌单
|
||||||
|
70. 收藏/取消收藏歌单
|
||||||
|
71. 歌单分类
|
||||||
|
72. 收藏的歌手列表
|
||||||
|
73. 订阅的电台列表
|
||||||
|
74. 相关歌单推荐
|
||||||
|
75. 付费精选接口
|
||||||
|
76. 音乐是否可用检查接口
|
||||||
|
77. 登录状态
|
||||||
|
78. 获取视频播放地址
|
||||||
|
79. 发送/删除评论
|
||||||
|
80. 热门评论
|
||||||
|
81. 视频评论
|
||||||
|
82. 退出登录
|
||||||
|
83. 所有榜单
|
||||||
|
84. 所有榜单内容摘要
|
||||||
|
85. 收藏视频
|
||||||
|
86. 收藏 MV
|
||||||
|
87. 视频详情
|
||||||
|
88. 相关视频
|
||||||
|
89. 关注用户
|
||||||
|
90. 新歌速递
|
||||||
|
91. 喜欢音乐列表(无序)
|
||||||
|
92. 收藏的 MV 列表
|
||||||
|
93. 获取最新专辑
|
||||||
|
94. 听歌打卡
|
||||||
|
95. 获取视频标签/分类下的视频
|
||||||
|
96. 已收藏专辑列表
|
||||||
|
97. 获取动态评论
|
||||||
|
98. 歌单收藏者列表
|
||||||
|
99. 云盘歌曲删除
|
||||||
|
100. 热门话题
|
||||||
|
101. 电台 - 推荐类型
|
||||||
|
102. 电台 - 非热门类型
|
||||||
|
103. 电台 - 今日优选
|
||||||
|
104. 心动模式/智能播放
|
||||||
|
105. 转发动态
|
||||||
|
106. 删除动态
|
||||||
|
107. 分享歌曲、歌单、mv、电台、电台节目到动态
|
||||||
|
108. 通知-私信
|
||||||
|
109. 通知-评论
|
||||||
|
110. 通知-@我
|
||||||
|
111. 通知-通知
|
||||||
|
112. 设置
|
||||||
|
113. 云盘数据详情
|
||||||
|
114. 私信内容
|
||||||
|
115. 我的数字专辑
|
||||||
|
116. batch批量请求接口
|
||||||
|
117. 获取视频标签列表
|
||||||
|
118. 全部mv
|
||||||
|
119. 网易出品mv
|
||||||
|
120. 收藏/取消收藏专辑
|
||||||
|
121. 专辑动态信息
|
||||||
|
122. 热搜列表(详细)
|
||||||
|
123. 更换绑定手机
|
||||||
|
124. 检测手机号码是否已注册
|
||||||
|
125. 初始化昵称
|
||||||
|
126. 更新歌单描述
|
||||||
|
127. 更新歌单名
|
||||||
|
128. 更新歌单标签
|
||||||
|
129. 默认搜索关键词
|
||||||
|
130. 删除歌单
|
||||||
|
131. 电台banner
|
||||||
|
132. 用户电台
|
||||||
|
133. 热门电台
|
||||||
|
134. 电台 - 节目详情
|
||||||
|
135. 电台 - 节目榜
|
||||||
|
136. 电台 - 新晋电台榜/热门电台榜
|
||||||
|
137. 类别热门电台
|
||||||
|
138. 云村热评
|
||||||
|
139. 电台24小时节目榜
|
||||||
|
140. 电台24小时主播榜
|
||||||
|
141. 电台最热主播榜
|
||||||
|
142. 电台主播新人榜
|
||||||
|
143. 电台付费精品榜
|
||||||
|
144. 歌手热门50首歌曲
|
||||||
|
145. 购买数字专辑
|
||||||
|
146. 获取 mv 点赞转发评论数数据
|
||||||
|
147. 获取视频点赞转发评论数数据
|
||||||
|
148. 调整歌单顺序
|
||||||
|
149. 调整歌曲顺序
|
||||||
|
150. 独家放送列表
|
||||||
|
151. 获取推荐视频
|
||||||
|
152. 获取视频分类列表
|
||||||
|
153. 获取全部视频列表接口
|
||||||
|
154. 获取历史日推可用日期列表
|
||||||
|
155. 获取历史日推详细数据
|
||||||
|
156. 国家编码列表
|
||||||
|
157. 首页-发现
|
||||||
|
158. 首页-发现-圆形图标入口列表
|
||||||
|
159. 数字专辑-全部新碟
|
||||||
|
160. 数字专辑-热门新碟
|
||||||
|
161. 数字专辑&数字单曲-榜单
|
||||||
|
162. 数字专辑-语种风格馆
|
||||||
|
163. 数字专辑详情
|
||||||
|
164. 更新头像
|
||||||
|
165. 歌单封面上传
|
||||||
|
166. 楼层评论
|
||||||
|
167. 歌手全部歌曲
|
||||||
|
168. 精品歌单标签列表
|
||||||
|
169. 用户等级信息
|
||||||
|
170. 电台个性推荐
|
||||||
|
171. 用户绑定信息
|
||||||
|
172. 用户绑定手机
|
||||||
|
173. 新版评论
|
||||||
|
174. 点赞过的视频
|
||||||
|
175. 收藏视频到视频歌单
|
||||||
|
176. 删除视频歌单里的视频
|
||||||
|
177. 最近播放的视频
|
||||||
|
178. 音乐日历
|
||||||
|
179. 电台订阅者列表
|
||||||
|
180. 云贝签到信息
|
||||||
|
181. 云贝签到
|
||||||
|
182. 云贝所有任务
|
||||||
|
183. 云贝todo任务
|
||||||
|
184. 云贝今日签到信息
|
||||||
|
185. 云贝完成任务
|
||||||
|
186. 云贝收入
|
||||||
|
187. 云贝支出
|
||||||
|
188. 云贝账户信息
|
||||||
|
189. 账号信息
|
||||||
|
|
||||||
|
## 更新日志
|
||||||
|
|
||||||
|
[changelog](https://github.com/Binaryify/NeteaseCloudMusicApi/blob/master/CHANGELOG.MD)
|
||||||
|
|
||||||
|
## 单元测试
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ npm test
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## 贡献者
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
[The MIT License (MIT)](https://github.com/Binaryify/NeteaseCloudMusicApi/blob/master/LICENSE)
|
||||||
117
netease_api/app.js
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const express = require('express');
|
||||||
|
const bodyParser = require('body-parser');
|
||||||
|
const request = require('./util/request');
|
||||||
|
const packageJSON = require('./package.json');
|
||||||
|
const exec = require('child_process').exec;
|
||||||
|
const cache = require('./util/apicache').middleware;
|
||||||
|
const { cookieToJson } = require('./util/index');
|
||||||
|
const fileUpload = require('express-fileupload');
|
||||||
|
// version check
|
||||||
|
exec('npm info NeteaseCloudMusicApi version', (err, stdout, stderr) => {
|
||||||
|
if (!err) {
|
||||||
|
let version = stdout.trim();
|
||||||
|
if (packageJSON.version < version) {
|
||||||
|
console.log(
|
||||||
|
`最新版本: ${version}, 当前版本: ${packageJSON.version}, 请及时更新`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
// CORS & Preflight request
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
if (req.path !== '/' && !req.path.includes('.')) {
|
||||||
|
res.set({
|
||||||
|
'Access-Control-Allow-Credentials': true,
|
||||||
|
'Access-Control-Allow-Origin': req.headers.origin || '*',
|
||||||
|
'Access-Control-Allow-Headers': 'X-Requested-With,Content-Type',
|
||||||
|
'Access-Control-Allow-Methods': 'PUT,POST,GET,DELETE,OPTIONS',
|
||||||
|
'Content-Type': 'application/json; charset=utf-8',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
req.method === 'OPTIONS' ? res.status(204).end() : next();
|
||||||
|
});
|
||||||
|
|
||||||
|
// cookie parser
|
||||||
|
app.use((req, res, next) => {
|
||||||
|
req.cookies = {};
|
||||||
|
(req.headers.cookie || '').split(/\s*;\s*/).forEach((pair) => {
|
||||||
|
let crack = pair.indexOf('=');
|
||||||
|
if (crack < 1 || crack == pair.length - 1) return;
|
||||||
|
req.cookies[
|
||||||
|
decodeURIComponent(pair.slice(0, crack)).trim()
|
||||||
|
] = decodeURIComponent(pair.slice(crack + 1)).trim();
|
||||||
|
});
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
|
// body parser
|
||||||
|
app.use(bodyParser.json());
|
||||||
|
app.use(bodyParser.urlencoded({ extended: false }));
|
||||||
|
|
||||||
|
app.use(fileUpload());
|
||||||
|
|
||||||
|
// static
|
||||||
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
|
// cache
|
||||||
|
app.use(cache('2 minutes', (req, res) => res.statusCode === 200));
|
||||||
|
// router
|
||||||
|
const special = {
|
||||||
|
'daily_signin.js': '/daily_signin',
|
||||||
|
'fm_trash.js': '/fm_trash',
|
||||||
|
'personal_fm.js': '/personal_fm',
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.readdirSync(path.join(__dirname, 'module'))
|
||||||
|
.reverse()
|
||||||
|
.forEach((file) => {
|
||||||
|
if (!file.endsWith('.js')) return;
|
||||||
|
let route =
|
||||||
|
file in special
|
||||||
|
? special[file]
|
||||||
|
: '/' + file.replace(/\.js$/i, '').replace(/_/g, '/');
|
||||||
|
let question = require(path.join(__dirname, 'module', file));
|
||||||
|
|
||||||
|
app.use(route, (req, res) => {
|
||||||
|
if (typeof req.query.cookie === 'string') {
|
||||||
|
req.query.cookie = cookieToJson(req.query.cookie);
|
||||||
|
}
|
||||||
|
let query = Object.assign(
|
||||||
|
{},
|
||||||
|
{ cookie: req.cookies },
|
||||||
|
req.query,
|
||||||
|
req.body,
|
||||||
|
req.files,
|
||||||
|
);
|
||||||
|
|
||||||
|
question(query, request)
|
||||||
|
.then((answer) => {
|
||||||
|
console.log('[OK]', decodeURIComponent(req.originalUrl));
|
||||||
|
res.append('Set-Cookie', answer.cookie);
|
||||||
|
res.status(answer.status).send(answer.body);
|
||||||
|
})
|
||||||
|
.catch((answer) => {
|
||||||
|
console.log('[ERR]', decodeURIComponent(req.originalUrl), {
|
||||||
|
status: answer.status,
|
||||||
|
body: answer.body,
|
||||||
|
});
|
||||||
|
if (answer.body.code == '301') answer.body.msg = '需要登录';
|
||||||
|
res.append('Set-Cookie', answer.cookie);
|
||||||
|
res.status(answer.status).send(answer.body);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const port = process.env.PORT || 3000;
|
||||||
|
const host = process.env.HOST || '';
|
||||||
|
|
||||||
|
app.server = app.listen(port, host, () => {
|
||||||
|
console.log(`server running @ http://${host ? host : 'localhost'}:${port}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = app;
|
||||||
60
netease_api/buildScript.js
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const express = require('express');
|
||||||
|
const request = require('./util/request');
|
||||||
|
const strip = require('strip-comments');
|
||||||
|
var router = express.Router();
|
||||||
|
const special = {
|
||||||
|
'daily_signin.js': '/daily_signin',
|
||||||
|
'fm_trash.js': '/fm_trash',
|
||||||
|
'personal_fm.js': '/personal_fm',
|
||||||
|
};
|
||||||
|
|
||||||
|
const app = express();
|
||||||
|
const temp = {};
|
||||||
|
|
||||||
|
fs.readdirSync(path.join(__dirname, 'module'))
|
||||||
|
.reverse()
|
||||||
|
.forEach((file) => {
|
||||||
|
if (!file.endsWith('.js')) return;
|
||||||
|
let route =
|
||||||
|
file in special
|
||||||
|
? special[file]
|
||||||
|
: '/' + file.replace(/\.js$/i, '').replace(/_/g, '/');
|
||||||
|
let question = require(path.join(__dirname, 'module', file));
|
||||||
|
// console.log(question.toString())
|
||||||
|
const func = `(req, res) => {
|
||||||
|
if (typeof req.query.cookie === 'string') {
|
||||||
|
req.query.cookie = cookieToJson(req.query.cookie);
|
||||||
|
}
|
||||||
|
let query = Object.assign(
|
||||||
|
{},
|
||||||
|
{ cookie: req.cookies },
|
||||||
|
req.query,
|
||||||
|
req.body,
|
||||||
|
req.files,
|
||||||
|
);
|
||||||
|
const ${file.replace(/\.js$/i, '')} = ${strip(question.toString())};
|
||||||
|
${file.replace(/\.js$/i, '')}(query, request)
|
||||||
|
.then((answer) => {
|
||||||
|
console.log('[OK]', decodeURIComponent(req.originalUrl));
|
||||||
|
res.append('Set-Cookie', answer.cookie);
|
||||||
|
res.status(answer.status).send(answer.body);
|
||||||
|
})
|
||||||
|
.catch((answer) => {
|
||||||
|
console.log('[ERR]', decodeURIComponent(req.originalUrl), {
|
||||||
|
status: answer.status,
|
||||||
|
body: answer.body,
|
||||||
|
});
|
||||||
|
if (answer.body.code == '301') answer.body.msg = '需要登录';
|
||||||
|
res.append('Set-Cookie', answer.cookie);
|
||||||
|
res.status(answer.status).send(answer.body);
|
||||||
|
})
|
||||||
|
}`;
|
||||||
|
temp[route] = func;
|
||||||
|
});
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.resolve(__dirname, './test_result.json'),
|
||||||
|
JSON.stringify(temp),
|
||||||
|
);
|
||||||
1311
netease_api/interface.d.ts
vendored
Normal file
26
netease_api/main.js
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
const request = require('./util/request');
|
||||||
|
const { cookieToJson } = require('./util/index');
|
||||||
|
|
||||||
|
let obj = {};
|
||||||
|
fs.readdirSync(path.join(__dirname, 'module'))
|
||||||
|
.reverse()
|
||||||
|
.forEach((file) => {
|
||||||
|
if (!file.endsWith('.js')) return;
|
||||||
|
let fileModule = require(path.join(__dirname, 'module', file));
|
||||||
|
obj[file.split('.').shift()] = function (data) {
|
||||||
|
if (typeof data.cookie === 'string') {
|
||||||
|
data.cookie = cookieToJson(data.cookie);
|
||||||
|
}
|
||||||
|
return fileModule(
|
||||||
|
{
|
||||||
|
...data,
|
||||||
|
cookie: data.cookie ? data.cookie : {},
|
||||||
|
},
|
||||||
|
request,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = obj;
|
||||||
19
netease_api/module/activate_init_profile.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// 初始化名字
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
nickname: query.nickname,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/eapi/activate/initProfile`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'eapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
url: '/api/activate/initProfile',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/album.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 专辑内容
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/album/${query.id}`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
17
netease_api/module/album_detail.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 数字专辑详情
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/vipmall/albumproduct/detail`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
17
netease_api/module/album_detail_dynamic.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 专辑动态信息
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/album/detail/dynamic`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
21
netease_api/module/album_list.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
// 数字专辑-新碟上架
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
area: query.area || 'ALL', //ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本
|
||||||
|
type: query.type,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/vipmall/albumproduct/list`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
20
netease_api/module/album_list_style.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 数字专辑-语种风格馆
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 10,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
area: query.area || 'Z_H', //Z_H:华语,E_A:欧美,KR:韩国,JP:日本
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/vipmall/appalbum/album/style`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/album_new.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 全部新碟
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
area: query.area || 'ALL', //ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/album/new`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
15
netease_api/module/album_newest.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 最新专辑
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/discovery/newAlbum`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
24
netease_api/module/album_songsaleboard.js
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
// 数字专辑&数字单曲-榜单
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
let data = {
|
||||||
|
albumType: query.albumType || 0, //0为数字专辑,1为数字单曲
|
||||||
|
};
|
||||||
|
const type = query.type || 'daily'; // daily,week,year,total
|
||||||
|
if (type === 'year') {
|
||||||
|
data = {
|
||||||
|
...data,
|
||||||
|
year: query.year,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/feealbum/songsaleboard/${type}/type`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
14
netease_api/module/album_sub.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
// 收藏/取消收藏专辑
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.t = query.t == 1 ? 'sub' : 'unsub';
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/album/${query.t}`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
15
netease_api/module/album_sublist.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 已收藏专辑列表
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 25,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/album/sublist`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
20
netease_api/module/artist_album.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 歌手专辑列表
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/artist/albums/${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
18
netease_api/module/artist_desc.js
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
// 歌手介绍
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/artist/introduction`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
37
netease_api/module/artist_list.js
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
// 歌手分类
|
||||||
|
|
||||||
|
/*
|
||||||
|
type 取值
|
||||||
|
1:男歌手
|
||||||
|
2:女歌手
|
||||||
|
3:乐队
|
||||||
|
|
||||||
|
area 取值
|
||||||
|
-1:全部
|
||||||
|
7华语
|
||||||
|
96欧美
|
||||||
|
8:日本
|
||||||
|
16韩国
|
||||||
|
0:其他
|
||||||
|
|
||||||
|
initial 取值 a-z/A-Z
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
initial: isNaN(query.initial)
|
||||||
|
? (query.initial || '').toUpperCase().charCodeAt() || undefined
|
||||||
|
: query.initial,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
limit: query.limit || 30,
|
||||||
|
total: true,
|
||||||
|
type: query.type || '1',
|
||||||
|
area: query.area,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/v1/artist/list`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
16
netease_api/module/artist_mv.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// 歌手相关MV
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
artistId: query.id,
|
||||||
|
limit: query.limit,
|
||||||
|
offset: query.offset,
|
||||||
|
total: true,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/artist/mvs`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
17
netease_api/module/artist_songs.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
private_cloud: 'true',
|
||||||
|
work_type: 1,
|
||||||
|
order: query.order || 'hot', //hot,time
|
||||||
|
offset: query.offset || 0,
|
||||||
|
limit: query.limit || 100,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/v1/artist/songs`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
20
netease_api/module/artist_sub.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 收藏与取消收藏歌手
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.t = query.t == 1 ? 'sub' : 'unsub';
|
||||||
|
const data = {
|
||||||
|
artistId: query.id,
|
||||||
|
artistIds: '[' + query.id + ']',
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/artist/${query.t}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/artist_sublist.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 关注歌手列表
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 25,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/artist/sublist`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
12
netease_api/module/artist_top_song.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
// 歌手热门 50 首歌曲
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/artist/top/song`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
15
netease_api/module/artists.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 歌手单曲
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/artist/${query.id}`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
19
netease_api/module/audio_match.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
const realData =
|
||||||
|
'eJx10mtIU2EcBvDtnCwNMfO2klUSmSQ5ZugKW/v/0TIjJVdhDStbXpqXrhY5Kwhtrcwiut9VSqMUMxX6IFqsD92sD1YgWGHRBcowKrpnPa/v+drg4flt572ds2PQ6XQut7MwJ940w2TOyS0pzF+/BV/MJrNO+3TVLOHUzKx5iw3/H5uZ7yxegct3tTl7Cr6QEa0gZ/dZOFsvfe5YHe1D+yFZxpncqEj/cCdwoirdVxHNnZrX3xygU5g7Eh6I9uOx8Ch4y9FQjlKkDz1pYrFXIJLUOovFGcYivqJgXqaXDqu7Rzc0XzmZxG81B/fF8wRVusn2jN5rDnwca8tFhyAJP4L4qiI9vX8cWzEmVKzT/46qxNpIdZOZz2HNcHhSkZ3D4AjYFpfGFkX6+dB+FvcSBe/SWbkLPVnEOJ1DFelXxVVci/Wj4TsBLhrQ/LGoaU4HxsTA28L76Cc8Dfau/U6F6FgkyBDDJar0g8tesmOvOHioWeXXmme6l3MLbIIre6wciU5E2t/k8WVxHfHvuUWXsH4SPCv1NW1Cz0aivgYO34vw1AEvi3MlIw0xHl6JNVPEGW41UJsqPaXYYTuEnotMdHwYfv7CFR/i+aXmrY5wrlSkEwr+0EJ0GvLmdw4/RS9Amj93UAbGZMIF40ezE3PtcG/yBWrT3L6oh66hFyMXK4xsUKT7aufzapxnFTwiNc3Wis5Bdm+OYCvmOuHj/ZeoQPOI00PUrUjXpG+kMFU61tFFDvQaZOn5DH4mzoLw4Hsaj14rzu/K4jF66fSWTnJinW3wBvcveqjZN3iFjKp0qKuF1mi21keST3NtTcbwu1eG3Dussr9eemljLIco0tVH7HwA493wOr+FlIjfy+GvkR4uwfjt4v/6G8K3NX8K38lt6B1ISa+Bv2O8Fy69foZOovci2S4Lr1aku4P9OEWVTt9wgMQ7exgJ8JXyI0W694WFyuBjcH75XyrEXsfhg+ZSvqZIf/Lct8Wp0md2tJN4PifEfjcm8gu02Ptbj459eum8eg8bFWlLXTb/A+uo9bM=';
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
algorithmCode: 'shazam_v2',
|
||||||
|
times: 1,
|
||||||
|
sessionId: 'C999431ACDC84EDBB984763654E6F8D7',
|
||||||
|
duration: 3.3066249999999995,
|
||||||
|
from: 'recognize-song',
|
||||||
|
rawdata: realData,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/music/audio/match`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
27
netease_api/module/avatar_upload.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
const uploadPlugin = require('../plugins/upload');
|
||||||
|
module.exports = async (query, request) => {
|
||||||
|
const uploadInfo = await uploadPlugin(query, request);
|
||||||
|
const res = await request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/user/avatar/upload/v1`,
|
||||||
|
{
|
||||||
|
imgid: uploadInfo.imgId,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
body: {
|
||||||
|
code: 200,
|
||||||
|
data: {
|
||||||
|
...uploadInfo,
|
||||||
|
...res.body,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
17
netease_api/module/banner.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 首页轮播图
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const type =
|
||||||
|
{
|
||||||
|
0: 'pc',
|
||||||
|
1: 'android',
|
||||||
|
2: 'iphone',
|
||||||
|
3: 'ipad',
|
||||||
|
}[query.type || 0] || 'pc';
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/v2/banner/get`,
|
||||||
|
{ clientType: type },
|
||||||
|
{ crypto: 'linuxapi', proxy: query.proxy, realIP: query.realIP },
|
||||||
|
);
|
||||||
|
};
|
||||||
19
netease_api/module/batch.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// 批量请求接口
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
e_r: true,
|
||||||
|
};
|
||||||
|
Object.keys(query).forEach((i) => {
|
||||||
|
if (/^\/api\//.test(i)) {
|
||||||
|
data[i] = query[i];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return request('POST', `https://music.163.com/eapi/batch`, data, {
|
||||||
|
crypto: 'eapi',
|
||||||
|
proxy: query.proxy,
|
||||||
|
url: '/api/batch',
|
||||||
|
cookie: query.cookie,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
12
netease_api/module/calendar.js
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
startTime: query.startTime || Date.now(),
|
||||||
|
endTime: query.endTime || Date.now(),
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/mcalendar/detail`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
14
netease_api/module/captcha_sent.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
// 发送验证码
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
ctcode: query.ctcode || '86',
|
||||||
|
cellphone: query.phone,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/sms/captcha/sent`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
20
netease_api/module/captcha_verify.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 校验验证码
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
ctcode: query.ctcode || '86',
|
||||||
|
cellphone: query.phone,
|
||||||
|
captcha: query.captcha,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/sms/captcha/verify`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
20
netease_api/module/cellphone_existence_check.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 检测手机号码是否已注册
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
cellphone: query.phone,
|
||||||
|
countrycode: query.countrycode,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/eapi/cellphone/existence/check`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'eapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
url: '/api/cellphone/existence/check',
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
34
netease_api/module/check_music.js
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
// 歌曲可用性
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
ids: '[' + parseInt(query.id) + ']',
|
||||||
|
br: parseInt(query.br || 999000),
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/song/enhance/player/url`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
).then((response) => {
|
||||||
|
let playable = false;
|
||||||
|
if (response.body.code == 200) {
|
||||||
|
if (response.body.data[0].code == 200) {
|
||||||
|
playable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (playable) {
|
||||||
|
response.body = { success: true, message: 'ok' };
|
||||||
|
return response;
|
||||||
|
} else {
|
||||||
|
response.status = 404;
|
||||||
|
response.body = { success: false, message: '亲爱的,暂无版权' };
|
||||||
|
return Promise.reject(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
21
netease_api/module/cloudsearch.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
// 搜索
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
s: query.keywords,
|
||||||
|
type: query.type || 1, // 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/cloudsearch/get/web`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
43
netease_api/module/comment.js
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
// 发送与删除评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
query.t = {
|
||||||
|
1: 'add',
|
||||||
|
0: 'delete',
|
||||||
|
2: 'reply',
|
||||||
|
}[query.t];
|
||||||
|
query.type = {
|
||||||
|
0: 'R_SO_4_', // 歌曲
|
||||||
|
1: 'R_MV_5_', // MV
|
||||||
|
2: 'A_PL_0_', // 歌单
|
||||||
|
3: 'R_AL_3_', // 专辑
|
||||||
|
4: 'A_DJ_1_', // 电台,
|
||||||
|
5: 'R_VI_62_', // 视频
|
||||||
|
6: 'A_EV_2_', // 动态
|
||||||
|
}[query.type];
|
||||||
|
const data = {
|
||||||
|
threadId: query.type + query.id,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (query.type == 'A_EV_2_') {
|
||||||
|
data.threadId = query.threadId;
|
||||||
|
}
|
||||||
|
if (query.t == 'add') data.content = query.content;
|
||||||
|
else if (query.t == 'delete') data.commentId = query.commentId;
|
||||||
|
else if (query.t == 'reply') {
|
||||||
|
data.commentId = query.commentId;
|
||||||
|
data.content = query.content;
|
||||||
|
}
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/resource/comments/${query.t}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_album.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// 专辑评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/R_AL_3_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_dj.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// 电台评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/A_DJ_1_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
20
netease_api/module/comment_event.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 获取动态评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/${query.threadId}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
27
netease_api/module/comment_floor.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.type = {
|
||||||
|
0: 'R_SO_4_', // 歌曲
|
||||||
|
1: 'R_MV_5_', // MV
|
||||||
|
2: 'A_PL_0_', // 歌单
|
||||||
|
3: 'R_AL_3_', // 专辑
|
||||||
|
4: 'A_DJ_1_', // 电台,
|
||||||
|
5: 'R_VI_62_', // 视频
|
||||||
|
}[query.type];
|
||||||
|
const data = {
|
||||||
|
parentCommentId: query.parentCommentId,
|
||||||
|
threadId: query.type + query.id,
|
||||||
|
time: query.time || -1,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/resource/comment/floor/get`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
30
netease_api/module/comment_hot.js
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
// 热门评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
query.type = {
|
||||||
|
0: 'R_SO_4_', // 歌曲
|
||||||
|
1: 'R_MV_5_', // MV
|
||||||
|
2: 'A_PL_0_', // 歌单
|
||||||
|
3: 'R_AL_3_', // 专辑
|
||||||
|
4: 'A_DJ_1_', // 电台,
|
||||||
|
5: 'R_VI_62_', // 视频
|
||||||
|
}[query.type];
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/hotcomments/${query.type}${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
16
netease_api/module/comment_hotwall_list.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// 云村热评
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/comment/hotwall/list/get`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
33
netease_api/module/comment_like.js
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
// 点赞与取消点赞评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
query.t = query.t == 1 ? 'like' : 'unlike';
|
||||||
|
query.type = {
|
||||||
|
0: 'R_SO_4_', // 歌曲
|
||||||
|
1: 'R_MV_5_', // MV
|
||||||
|
2: 'A_PL_0_', // 歌单
|
||||||
|
3: 'R_AL_3_', // 专辑
|
||||||
|
4: 'A_DJ_1_', // 电台,
|
||||||
|
5: 'R_VI_62_', // 视频
|
||||||
|
6: 'A_EV_2_', // 动态
|
||||||
|
}[query.type];
|
||||||
|
const data = {
|
||||||
|
threadId: query.type + query.id,
|
||||||
|
commentId: query.cid,
|
||||||
|
};
|
||||||
|
if (query.type == 'A_EV_2_') {
|
||||||
|
data.threadId = query.threadId;
|
||||||
|
}
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/comment/${query.t}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_music.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// 歌曲评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/v1/resource/comments/R_SO_4_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_mv.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// MV评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/R_MV_5_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
38
netease_api/module/comment_new.js
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
// 评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
query.type = {
|
||||||
|
0: 'R_SO_4_', // 歌曲
|
||||||
|
1: 'R_MV_5_', // MV
|
||||||
|
2: 'A_PL_0_', // 歌单
|
||||||
|
3: 'R_AL_3_', // 专辑
|
||||||
|
4: 'A_DJ_1_', // 电台,
|
||||||
|
5: 'R_VI_62_', // 视频
|
||||||
|
6: 'A_EV_2_', // 动态
|
||||||
|
}[query.type];
|
||||||
|
const threadId = query.type + query.id;
|
||||||
|
const pageSize = query.pageSize || 20;
|
||||||
|
const pageNo = query.pageNo || 1;
|
||||||
|
const data = {
|
||||||
|
threadId: threadId, //'R_SO_4_863481066',
|
||||||
|
pageNo,
|
||||||
|
showInner: query.showInner || true,
|
||||||
|
pageSize,
|
||||||
|
cursor:
|
||||||
|
+query.sortType === 3 ? query.cursor || '0' : (pageNo - 1) * pageSize,
|
||||||
|
sortType: query.sortType || 1, //1:按推荐排序,2:按热度排序,3:按时间排序
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/v2/resource/comments`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'eapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
url: '/api/v2/resource/comments',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_playlist.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// 歌单评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/A_PL_0_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
22
netease_api/module/comment_video.js
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
// 视频评论
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
const data = {
|
||||||
|
rid: query.id,
|
||||||
|
limit: query.limit || 20,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
beforeTime: query.before || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/v1/resource/comments/R_VI_62_${query.id}`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
16
netease_api/module/countries_code_list.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
// 国家编码列表
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://interface3.music.163.com/eapi/lbs/countries/v1`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'eapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
url: '/api/lbs/countries/v1',
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
20
netease_api/module/daily_signin.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 签到
|
||||||
|
|
||||||
|
/*
|
||||||
|
0为安卓端签到 3点经验, 1为网页签到,2点经验
|
||||||
|
签到成功 {'android': {'point': 3, 'code': 200}, 'web': {'point': 2, 'code': 200}}
|
||||||
|
重复签到 {'android': {'code': -2, 'msg': '重复签到'}, 'web': {'code': -2, 'msg': '重复签到'}}
|
||||||
|
未登录 {'android': {'code': 301}, 'web': {'code': 301}}
|
||||||
|
*/
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
type: query.type || 0,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/point/dailyTask`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
27
netease_api/module/digitalAlbum_ordering.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
// 购买数字专辑
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
business: 'Album',
|
||||||
|
paymentMethod: query.payment,
|
||||||
|
digitalResources: JSON.stringify([
|
||||||
|
{
|
||||||
|
business: 'Album',
|
||||||
|
resourceID: query.id,
|
||||||
|
quantity: query.quantity,
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
from: 'web',
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/ordering/web/digital`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
20
netease_api/module/digitalAlbum_purchased.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
// 我的数字专辑
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
total: true,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/digitalAlbum/purchased`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
17
netease_api/module/dj_banner.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 电台banner
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {};
|
||||||
|
query.cookie.os = 'pc';
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/djradio/banner/get`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/dj_category_excludehot.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 电台非热门类型
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/djradio/category/excludehot`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/dj_category_recommend.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 电台推荐类型
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/djradio/home/category/recommend`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
15
netease_api/module/dj_catelist.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
// 电台分类列表
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/djradio/category/get`,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
13
netease_api/module/dj_detail.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
// 电台详情
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.rid,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/djradio/v2/get`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
14
netease_api/module/dj_hot.js
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
// 热门电台
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/weapi/djradio/hot/v1`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||
19
netease_api/module/dj_paygift.js
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// 付费电台
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/djradio/home/paygift/list?_nmclfl=1`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
17
netease_api/module/dj_personalize_recommend.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
// 电台个性推荐
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/api/djradio/personalize/rcmd`,
|
||||||
|
{
|
||||||
|
limit: query.limit || 6,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
21
netease_api/module/dj_program.js
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
// 电台节目列表
|
||||||
|
const { toBoolean } = require('../util');
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
radioId: query.rid,
|
||||||
|
limit: query.limit || 30,
|
||||||
|
offset: query.offset || 0,
|
||||||
|
asc: toBoolean(query.asc),
|
||||||
|
};
|
||||||
|
return request(
|
||||||
|
'POST',
|
||||||
|
`https://music.163.com/weapi/dj/program/byradio`,
|
||||||
|
data,
|
||||||
|
{
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
};
|
||||||
13
netease_api/module/dj_program_detail.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
// 电台节目详情
|
||||||
|
|
||||||
|
module.exports = (query, request) => {
|
||||||
|
const data = {
|
||||||
|
id: query.id,
|
||||||
|
};
|
||||||
|
return request('POST', `https://music.163.com/api/dj/program/detail`, data, {
|
||||||
|
crypto: 'weapi',
|
||||||
|
cookie: query.cookie,
|
||||||
|
proxy: query.proxy,
|
||||||
|
realIP: query.realIP,
|
||||||
|
});
|
||||||
|
};
|
||||||