网易云音乐 API Golang 实现

网易云音乐 API-Go

网易云音乐 Golang API 实现

灵感来自

Binaryify/NeteaseCloudMusicApi

说明

Binaryify/NeteaseCloudMusicApi 不同的是,本项目将全部采用 Eapi(即网易云音乐客户端使用的API)

本项目可能会很咕,欢迎各位的 issue 与 pr

API 列表

目前仅实现了少部分API:

  • 获取音乐 URL
  • 获取音乐详细信息
  • 发送私信(支持图片)
  • 发送/删除动态(支持图片)
  • 发送/删除 Mlog(仅支持图片)
  • 发送/删除评论
  • 获取 NosToken 以及 上传文件
  • QR 登录
  • 批处理
  • 短链接生成
  • 获取云豆数量 1
  • 获取登录状态 1
  • 音乐人签到 1
  • 获取音乐人任务列表 1
  • 用户签到 1
  • 领取云豆 1
  • 获取用户详细信息 1
  • 获取用户信息 1
  • 获取用户设置 1

API 调用文档

GetSongDetail 获取歌曲详细信息

package main

import (
   "fmt"
   "github.com/XiaoMengXinX/Music163Api-Go/api"
   "github.com/XiaoMengXinX/Music163Api-Go/utils"
)

func main() {
   data := utils.RequestData{}

    result, _ := api.GetSongDetail(data, []int{1295601353}) // 获取 ID:1295601353 的详细信息

   fmt.Println(result.Songs[0].Name) // 打印歌曲名称
}

返回

生而为人,我很抱歉(VOCALOID)

GetSongURL 获取歌曲 URL

data := utils.RequestData{
    Cookies: utils.Cookies{
        {
            Key:   "MUSIC_U", // 获取无损音质需填写 Cookies 中的 MUSIC_U
            Value: "984e8c072dc9c670f40d019a3699f326a6d9565cd22e7bcb944dfa4deb7124ae33a649814",
        },
    },
}

result, _ := api.GetSongURL(data, api.SongURLConfig{Ids: []int{1295601353}}) // 获取 ID:1295601353 的歌曲 URL

fmt.Println(result.Data[0].Url) // 打印歌曲 URL

返回

http://m8.music.126.net/20210829141922/e77fa9b153aaadd41bf5e344ce7c847e/ymusic/0edd/e4e3/4eaf/d2db5cbbef195ff34812eb8c82c83d67.flac

Batch 批处理

示例:获取当前 Cookie 的用户 ID

data := utils.RequestData{
    Cookies: utils.Cookies{
        {
            Key:   "MUSIC_U",
            Value: "984e8c072dc9c670f40d019a3699f326a6d9565cd22e7bcb944dfa4deb7124ae33a649814e309366",
        },
    },
}

batch := api.Batch{} // 创建 Batch 对象
batch.Init() // Batch 初始化
batch.Add(api.BatchAPI{Key: api.UserSetting}) // 添加要 Batch 的 API

result ,_ ,_ := batch.Do(data) // 请求 Batch API

var userData types.BatchUserSettingData
_ = json.Unmarshal([]byte(result), &userData) // Batch 需额外解析 json 数据

fmt.Println(userData.Api.Setting.UserId) // 打印用户 ID

Batch 可用的 API 列表详见 https://pkg.go.dev/github.com/XiaoMengXinX/Music163Api-Go/api#pkg-constants

Footnotes

  1. 为 weapi 接口,但使用 eapi 方法进行请求 2 3 4 5 6 7 8 9

Owner
Similar Resources

A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021

REST API made using native Golang libraries. This API resembles the basic working of Instagram.

REST API made using native Golang libraries. This API resembles the basic working of Instagram.

Golang RESTful API for Instagram A Go based REST API built using native libraries. The API has been thoroughly worked through with Postman. Routes inc

Mar 16, 2022

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

Aug 20, 2022

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

Dec 13, 2021

Arweave-api - Arweave API implementation in golang

Arweave API Go implementation of the Arweave API Todo A list of endpoints that a

Jan 16, 2022

Basic-api-with-go - A basic api with golang

I am creating my first API with GO. Install go get -u github.com/Yefhem/basic-ap

Jan 3, 2022

Weather api - A Simple Weather API Example With Golang

Example import: import "github.com/mr-joshcrane/weather_api" Example of Library

Jan 5, 2022

Bui api login - Bui api login in golang

bui-api-login Project setup go mod tidy -compat=1.17 .env.local OAUTH2_REDIRECT

Jan 7, 2022

Go-block-api - Golang implementation of Ethereum Block API

Go Ethereum Block API Golang implementation of Ethereum Block API This API can s

Jan 13, 2022

Api-project - Api project with Golang, Gorm, Gorilla-Mux, Postgresql

TECHNOLOGIES GOLANG 1.14 GORM GORILLA-MUX POSTGRESQL API's PATHS For Product Ser

Nov 23, 2022

Reservationbox-api - Reservationbox Api with golang

Reservationbox-api - Reservationbox Api with golang

reservationbox-api How to set up application Cloning git on this link : https://

Jan 30, 2022

Go-gin-mongo-api - A backend RESTful API built using golang, gin and mongoDB

go-gin-mongo-API This is a RESTful backend API which is developed using the gola

Jul 19, 2022

Go api infra - Infrastructure for making api on golang so easy

Go Infra Api Infrastructre methods and types for make api simple Response abstra

Jun 18, 2022

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

A GoLang wrapper for Politics & War's API. Forego the hassle of accessing the API directly!

Mar 5, 2022

Golang API for Whatsapp API MultiDevice version

Golang API for Whatsapp API MultiDevice version

Go Whatsapp API Multi Device Version Required Mac OS: brew install vips export C

Jan 3, 2023

Awb-kh-api - AWB KH API WITH GOLANG

AWB KH API Da die vorhandene API des Abfallwirtschaftsbetriebs in Bad Kreuznach

Feb 11, 2022

Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

Telego is Telegram Bot API library for Golang with full API implementation (one-to-one)

Telego • Go Telegram Bot API Telego is Telegram Bot API library for Golang with full API implementation (one-to-one) The goal of this library was to c

Jan 5, 2023

Go-Mongodb API - A sample REST API ( CRUD operations ) created using Golang

Go-Mongodb_API This is a sample REST API ( CRUD operations ) created using the G

May 31, 2022

Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv

Go OpenCV binding A Golang binding for OpenCV. OpenCV 1.x C API bindings through CGO, and OpenCV 2+ C++ API (GoCV) through SWIG. Disclaimer This is a

Dec 21, 2022
Golang bindings for libmediainfo

mediainfo Golang binding for libmediainfo Duration, Bitrate, Codec, Streams and a lot of other meta-information about media files can be extracted thr

Nov 16, 2022
Chord transposer for Golang.

Go Chord Transposer Chord transposer for Golang. It will detect chords inside multiline string(Song guitar chords) then replace the chords given strin

Oct 24, 2022
Created to make analysis about lyrics of songs in golang

?? WordFinder ??️ Current State This repository has been created to make analysis about lyrics of songs, the goal is to provide tool which will be abl

Nov 29, 2021
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022
Go (Golang) API REST with Gin FrameworkGo (Golang) API REST with Gin Framework

go-rest-api-aml-service Go (Golang) API REST with Gin Framework 1. Project Description Build REST APIs to support AML service with the support of exte

Nov 21, 2021
弹弹play 资源搜索节点 API 实现,基于 Cloudflare Workers 或 Golang 的两种实现。 || API implementations for "dandanplay" resource search service.

dandanplay-resource-service API implementations for "dandanplay" resource search service. 弹弹play 资源搜索节点的 API 实现。 提供基于 Cloudflare Workers 和 Golang 的两种实

Dec 5, 2022
Golang API wrapper for MangaDex v5's MVP API.

mangodex Golang API wrapper for MangaDex v5's MVP API. Full documentation is found here. This API is still in Open Beta, so testing may not be complet

Oct 23, 2022
An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022
A microservice gateway developed based on golang.With a variety of plug-ins which can be expanded by itself, plug and play. what's more,it can quickly help enterprises manage API services and improve the stability and security of API services.
A microservice gateway developed based on golang.With a variety of plug-ins which can be expanded by itself, plug and play. what's more,it can quickly help enterprises manage API services and improve the stability and security of API services.

Goku API gateway is a microservice gateway developed based on golang. It can achieve the purposes of high-performance HTTP API forwarding, multi tenant management, API access control, etc. it has a powerful custom plug-in system, which can be expanded by itself, and can quickly help enterprises manage API services and improve the stability and security of API services.

Dec 29, 2022