Giter Club home page Giter Club logo

musicparty's Introduction

Music Party

No Chinese?

别急,主要是因为输代码懒得切中文,所以有空再写。

How to Build

This repo contains the front-end project and the back-end projects (including music api projects).

Requirements

  • .NET SDK 6.0
  • nodejs with pnpm package manager

Front End Building

The front-end project is in the "music-party" folder. You need to use pnpm to build it.

cd music-party && pnpm install && pnpm build

Back End Building

The back-end project is in the "MusicParty" folder. You need .NET SDK 6.0 to build it. cd MusicParty && dotnet build

How to Use

Read this part after you know how to build the projects.

Front End

cd music-party && pnpm start

Music Api

Now, there are Netease Cloud Music, QQ Music and Bilibili api supports in this repo.

Edit settings in MusicParty/appsettings.json to specify which music api you want to enable, turn the MusicApi.XXX.Enabled to false if you don't want to use it.

For Netease Cloud Music and QQ Music, you need the cookie of a certain account to access the music services. For Bilibili, you need SESSDATA, just part of the cookie.

If you want to use Netease Cloud Music API, start a server by running npx NeteaseCloudMusicApi@latest.

If you want to use QQ Music API, follow this instruction to start a server.

You can write your own music api adapter, just implement the interface in MusicApiContract/IMusicApi.cs and register it in MusicParty/Program.cs.

Back End

Provide your front-end server url and music api server urls in MusicParty/appsettings.json and run cd MusicParty && dotnet run -c release.

Use Docker

I strongly recommend you to use this method to deloy this repo.

  1. Clone this repo, and complete the settings in docker-compose.yml. You can disable music apis which you don't want to use. If you want to use a certain music api, you should provide the corresponding cookie or some other credential. You can't start the project without any music api.
  2. Run docker compose up. Notice that the default port is "2706", you can modify it in docker-compose.yml.

musicparty's People

Contributors

eveelseif avatar lgc2333 avatar liulifox233 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

musicparty's Issues

【新功能】倒计时关闭

弄一个Timer 然后到时间直接关闭页面或者暂停播放?
也许可以再加一个到到时间后等待歌曲播完停止的特性?

The Compose file is invalid

ERROR: The Compose file is invalid because:
Service neteaseapi has neither an image nor a build context specified. At least one must be provided.

docker部署错误

[root@centos-192 MusicParty]# docker-compose up -d
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the services key, or omit the version key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

【BUG】非ck绑定者在网页绑定QQ后提示错误

fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMOVK7TJ2Q39", Request id "0HMOVK7TJ2Q39:00000012": An unhandled exception was thrown by the application.
System.InvalidOperationException: An element of type 'String' cannot be converted to a 'System.Int64'.
at System.Text.Json.Nodes.JsonValue1.ConvertJsonElement[TypeToConvert]() at System.Text.Json.Nodes.JsonValue1.GetValueT
at MusicParty.MusicApi.QQMusic.QQMusicApi.<>c.b__12_0(JsonNode x) in C:\Music\MusicParty\QQMusicApi\QQMusicApi.cs:line 106
at System.Linq.Enumerable.SelectIListIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at System.Linq.Enumerable.ConcatIterator1.MoveNext() at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonCollectionConverter2.OnTryWrite(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.Serialization.JsonConverter1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state) at System.Text.Json.Serialization.JsonConverter1.WriteCoreAsObject(Utf8JsonWriter writer, Object value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteCore[TValue](JsonConverter jsonConverter, Utf8JsonWriter writer, TValue& value, JsonSerializerOptions options, WriteStack& state)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at System.Text.Json.JsonSerializer.WriteStreamAsync[TValue](Stream utf8Json, TValue value, JsonTypeInfo jsonTypeInfo, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Mvc.Formatters.SystemTextJsonOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding selectedEncoding)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at MusicParty.PreprocessMiddleware.InvokeAsync(HttpContext context) in C:\Music\MusicParty\MusicParty\Preproce
EPKGOY5O9VASCAVUQ G7LO0
ssMiddleware.cs:line 31
at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)

Bilibili 多 P 视频支持

希望能够识别 B 站的多 P 视频,最好能够自定义添加某几 P 的视频,感谢开发者!

【建议】换源

可以将Api换成listen1的api(易于部署+音乐平台完备),这样再开发难度也降低不少(写酷我api写疯了的我)

fetch不到,系统不对

docker-compose up
Building neteaseapi
Sending build context to Docker daemon 480.8kB
Step 1/3 : FROM node:slim
slim: Pulling from library/node
bb263680fed1: Pull complete
90145816ab6f: Pull complete
ffecf77c2ec8: Pull complete
93607e2e5985: Pull complete
39f3b390c480: Pull complete
Digest: sha256:34211d15e360eff92c17587ff3c3d3bea3061ca3961f745fd59ab30bda954ff9
Status: Downloaded newer image for node:slim
---> 7647830b98c6
Step 2/3 : RUN npm install -g NeteaseCloudMusicApi
---> Running in 2c720edaefe4

added 179 packages in 24s

18 packages are looking for funding
run npm fund for details
npm notice
npm notice New patch version of npm available! 9.4.0 -> 9.4.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.4.2
npm notice Run npm install -g [email protected] to update!
npm notice
Removing intermediate container 2c720edaefe4
---> 4c68237520b1
Step 3/3 : ENTRYPOINT [ "NeteaseCloudMusicApi" ]
---> Running in 9bc39e78bf74
Removing intermediate container 9bc39e78bf74
---> d32d92bfa769
Successfully built d32d92bfa769
Successfully tagged musicparty_neteaseapi:latest
WARNING: Image for service neteaseapi was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build.
Building qqmusicapi
Sending build context to Docker daemon 480.8kB
Step 1/8 : FROM node:slim
---> 7647830b98c6
Step 2/8 : RUN apt update
---> Running in 08ed6b486532

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Err:1 http://deb.debian.org/debian bullseye InRelease
Could not connect to deb.debian.org:80 (151.101.110.132), connection timed out
Err:2 http://deb.debian.org/debian-security bullseye-security InRelease
Unable to connect to deb.debian.org:80:
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
Unable to connect to deb.debian.org:80:
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease Could not connect to deb.debian.org:80 (151.101.110.132), connection timed out
W: Failed to fetch http://deb.debian.org/debian-security/dists/bullseye-security/InRelease Unable to connect to deb.debian.org:80:
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Unable to connect to deb.debian.org:80:
W: Some index files failed to download. They have been ignored, or old ones used instead.
Removing intermediate container 08ed6b486532
---> 530e130eaa05
Step 3/8 : RUN apt install unzip wget -y
---> Running in 5c6bd2521769

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package unzip
E: Unable to locate package wget
The command '/bin/sh -c apt install unzip wget -y' returned a non-zero code: 100
ERROR: Service 'qqmusicapi' failed to build : Build failed

绑定QQ音乐时会出现bug,部分群u的qq号出现此问题

Connection id "0HMR*****NJ", Request id "0HMR9CNJ:0000": An unhandled exception was thrown by the application.
musicparty-backend-1 | System.InvalidOperationException: An element of type 'String' cannot be converted to a 'System.Int64'.
musicparty-backend-1 | at System.Text.Json.Nodes.JsonValue1.ConvertJsonElement[TypeToConvert]() musicparty-backend-1 | at System.Text.Json.Nodes.JsonValue1.GetValueT
musicparty-backend-1 | at MusicParty.MusicApi.QQMusic.QQMusicApi.<>c.b__12_0(JsonNode x) in /src/QQMusicApi/QQMusicApi.cs:line 106
musicparty-backend-1 | at System.Linq.Enumerable.SelectIListIterator2.MoveNext() musicparty-backend-1 | at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
musicparty-backend-1 | at System.Linq.Enumerable.ConcatIterator1.MoveNext() musicparty-backend-1 | at System.Text.Json.Serialization.Converters.IEnumerableDefaultConverter2.OnWriteResume(Utf8JsonWriter writer, TCollection value, JsonSerializerOptions options, WriteStack& state)

无法点歌

从网易云和bilibili点歌,提示
image
从QQ音乐点歌提示成功,但是队列中没有歌曲

bilibili登录时出现问题

musicparty-backend-1 | You are going to login your Bilibili Account...
musicparty-backend-1 | Unhandled exception. System.AggregateException: One or more errors occurred. (Response
status code does not indicate success: 404 (Not Found).)
musicparty-backend-1 | ---> System.Net.Http.HttpRequestException: Response status code does not indicate suc
cess: 404 (Not Found).
musicparty-backend-1 | at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
musicparty-backend-1 | at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, Cancel
lationToken cancellationToken)
musicparty-backend-1 | at MusicParty.MusicApi.Bilibili.BilibiliApi.CheckSESSDATAAsync(String sessdata) in
/src/BilibiliApi/BilibiliApi.cs:line 51
musicparty-backend-1 | at MusicParty.MusicApi.Bilibili.BilibiliApi.SESSDATALogin(String sessdata) in /src/
BilibiliApi/BilibiliApi.cs:line 39
musicparty-backend-1 | --- End of inner exception stack trace ---
musicparty-backend-1 | at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExcept
ions)
musicparty-backend-1 | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken ca
ncellationToken)
musicparty-backend-1 | at System.Threading.Tasks.Task.Wait()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.