Skip to content

Commit

Permalink
更新ci
Browse files Browse the repository at this point in the history
  • Loading branch information
MonoLogueChi committed Feb 16, 2020
1 parent 37a5b2c commit 093dca6
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 96 deletions.
57 changes: 0 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,6 @@

因为作者免费提供那个弹幕服务器貌似是挂掉了,看了一下开源的[源码](https://github.com/MoePlayer/DPlayer-node),还需要`docker`,我看到这东西就烦,然后转手就自己撸了一个出来。

## 这货有哪些功能?

原版有的功能这东西都有,顺便增强了一下BiliBili弹幕解析能力

- [x] 独立弹幕(和原版一样)
- [x] 解析BiliBili弹幕(支持分P和历史弹幕)

## 这货性能怎么样?

这个问题不好回答,具体性能,并发能力我也没测试过,如果哪位老哥是搞测试的,可以帮忙测试一下那就更好了。

为什么选择PostgreSQL作为数据库?这个纯粹是一个练手的项目,最开始打算是用Redis,但是对这东西一点也不了解,就先pass了。后来用了MySQL,等后面我就开始思考,能不能利用MySQL的NOSQL特性提高一下性能呢?但是我的测试机器只有1G内存,要跑MySQL5.7,甚至MySQL8.0,不想说什么了。再后来受到其他项目的启发,选择了PostgreSQL,试了一下编译安装,过程非常简单,没遇到什么坑,再试一下数据库操作,也非常简单,中间也没有有道什么坑,就这样确定了最终使用的数据库。

## 怎么用?

后面会写一个关于编译和部署的教程的,如果需要的人多的话,Docker版也在计划之内。

## 会不会提供免费的弹幕服务器?

拿国外的小JJ搞了一个,性能有限,不提供任何保障,随时有可能挂掉,随时可能删库跑路,仅作演示使用,请勿用于生产环境

弹幕接口 `https://danmaku.xwhite.studio/api/dplayer/`

## 示例?

简单给一个吧
视频:[https://dandoc.u2sb.top/danmaku/index.html](https://dandoc.u2sb.top/danmaku/index.html)
普通弹幕接口 https://danmaku.xwhite.studio/api/dplayer/v3/?id=C6CC6218F1FB8770 (视频设定的id,最大长度32,推荐使用视频的CRC等唯一值作为id)
BiliBili弹幕接口:
- https://danmaku.xwhite.studio/api/dplayer/v3/bilibili/?cid=28019559
- https://danmaku.xwhite.studio/api/dplayer/v3/bilibili?aid=17150441&p=1
- https://danmaku.xwhite.studio/api/dplayer/v3/bilibili/?cid=1176840
- https://danmaku.xwhite.studio/api/dplayer/v3/bilibili?aid=810872&p=1

Dplayer弹幕接口:

```js
danmaku: {
id: 'C6CC6218F1FB8770', //建议使用视频 CRC64 或者其他唯一值
api: 'https://danmaku.xwhite.studio/api/dplayer/',
addition: ['https://danmaku.xwhite.studio/api/dplayer/v3/bilibili?cid=cid'] //可使用 cid 或者aid + p作为参数,p 默认为1
}
```

## ArtPlayer弹幕

普通弹幕接口 https://danmaku.xwhite.studio/api/artplayer/v1/?id=C6CC6218F1FB8770
BiliBili弹幕代理
- https://danmaku.xwhite.studio/api/artplayer/v1/bilibili/?cid=1176840
- https://danmaku.xwhite.studio/api/artplayer/v1/bilibili?aid=810872&p=1

## TODO

- [ ] 管理面板
- [x] 直播弹幕
- [x] BiliBili历史弹幕叠加

## 反馈

![](https://s2.ax1x.com/2020/02/14/1jAh1U.png)
201 changes: 162 additions & 39 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,169 @@
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master
- releases/*
- master
- releases/*

pool:
vmImage: 'ubuntu-latest'
vmImage: "ubuntu-latest"

steps:
- task: CmdLine@2
inputs:
script: |
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
dotnet remove Danmaku package Microsoft.VisualStudio.Web.CodeGeneration.Design
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '-c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: False

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/Danmaku'
includeRootFolder: true
archiveType: 'tar'
tarCompression: 'xz'
archiveFile: '$(Build.ArtifactStagingDirectory)/linux64.tar.xz'
replaceExistingArchive: true

- task: GithubRelease@0
displayName: 'Edit GitHub Release'
inputs:
gitHubConnection: MonoLogueChiToken
repositoryName: MonoLogueChi/Dplayer.Danmaku
action: create
tag: $(Build.BuildNumber)
assets: $(Build.ArtifactStagingDirectory)/*.tar.xz
- task: CmdLine@2
inputs:
script: |
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
dotnet remove Danmaku package Microsoft.VisualStudio.Web.CodeGeneration.Design
##编译Linux版
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmaku64-R2R"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux64 -r linux-x64 --self-contained true --output $(Build.ArtifactStagingDirectory)/Danmaku64-R2R-SCD"
zipAfterPublish: False

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64-R2R/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux64.r2r.tar.xz"
replaceExistingArchive: true

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64-R2R-SCD/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux64.r2r.scd.tar.xz"
replaceExistingArchive: true

- task: CmdLine@2
inputs:
script: |
sed -i 's/<PublishReadyToRun>true/<PublishReadyToRun>false/g' ./Danmaku/Danmaku.csproj
rm -r ./Danmaku/bin
##编译Linux版
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmaku64"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux64 -r linux-x64 --self-contained true --output $(Build.ArtifactStagingDirectory)/Danmaku64-SCD"
zipAfterPublish: False

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux64.tar.xz"
replaceExistingArchive: true

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64-SCD/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux64.scd.tar.xz"
replaceExistingArchive: true

## 编译arm版
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux32 -r linux-arm --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmaku32-Arm"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Linux32 -r linux-arm --self-contained true --output $(Build.ArtifactStagingDirectory)/Danmaku32-Arm-SCD"
zipAfterPublish: False

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku32-Arm/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux.arm.tar.xz"
replaceExistingArchive: true

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku32-Arm-SCD/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/linux.arm.scd.tar.xz"
replaceExistingArchive: true

## 编译Win版
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Win -r win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmaku64-Win"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "-c Release-Win -r win-x64 --self-contained true --output $(Build.ArtifactStagingDirectory)/Danmaku64-Win-SCD"
zipAfterPublish: False

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64-Win/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/win64.tar.xz"
replaceExistingArchive: true

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmaku64-Win-SCD/Danmaku"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
archiveFile: "$(Build.ArtifactStagingDirectory)/win64.scd.tar.xz"
replaceExistingArchive: true

## 提交
- task: GithubRelease@0
displayName: "Edit GitHub Release"
inputs:
gitHubConnection: MonoLogueChiToken
repositoryName: MonoLogueChi/Dplayer.Danmaku
action: create
tag: $(Build.BuildNumber)
assets: $(Build.ArtifactStagingDirectory)/*.tar.xz

0 comments on commit 093dca6

Please sign in to comment.