forked from ape-byte/DouyinBarrageGrab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ape-byte#11 from HaoDong108/master
Master
- Loading branch information
Showing
28 changed files
with
1,311 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Sync To Gitee | ||
|
||
on: [push, delete, create] | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Sync to Gitee | ||
uses: wearerequired/git-mirror-action@master | ||
env: | ||
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }} | ||
with: | ||
source-repo: | ||
destination-repo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!--配置更改后重启才能生效--> | ||
<appSettings> | ||
|
||
<!--过滤Websocket数据源进程,可用','进行分隔,程序将会监听以下进程的弹幕信息--> | ||
<add key="processFilter" value="直播伴侣,chrome,msedge,douyin"/> | ||
|
||
<!--Websocket监听端口--> | ||
<add key="wsListenPort" value="8888"/> | ||
<!--在控制台输出弹幕--> | ||
<add key="printBarrage" value="true"/> | ||
<!--要在控制台打印的弹幕类型,可以用','隔开 all[全部],1[普通弹幕],2[点赞消息],3[进入直播间],4[关注消息],5[礼物消息],6[统计消息],7[粉丝团消息]--> | ||
<add key="printFilter" value="all"/> | ||
<!--系统代理端口--> | ||
<add key="proxyPort" value="8827"/> | ||
<!--开启内置的域名过滤,设置为false会解包所有https请求,cpu占用很高,建议在无法获取弹幕数据时调整 --> | ||
<add key="filterHostName" value="true"/> | ||
<!--已知的弹幕域名列表 ','分隔 用作过滤规则中,凡是webcast开头的域名程序都会自动列入白名单--> | ||
<add key="hostNameFilter" value=" | ||
webcast3-ws-web-hl.douyin.com, | ||
webcast3-ws-web-lf.douyin.com, | ||
webcast100-ws-web-lq.amemv.com, | ||
frontier-im.douyin.com, | ||
"/> | ||
<!--要进行过滤的房间ID,不填代表监听所有,多项使用','分隔,浏览器进入直播间 F12 控制台输入 'window.localStorage.playRoom' 即可快速看到房间ID(不是地址栏中的那个) --> | ||
<add key="roomIds" value=""/> | ||
</appSettings> | ||
<!--配置更改后重启才能生效--> | ||
<appSettings> | ||
<!--过滤Websocket数据源进程,可用','进行分隔,程序将会监听以下进程的弹幕信息--> | ||
<add key="processFilter" value="直播伴侣,douyin,chrome,msedge,QQBrowser,360se,firefox,2345explorer,iexplore" /> | ||
<!--Websocket监听端口--> | ||
<add key="wsListenPort" value="8888" /> | ||
<!--true:监听在0.0.0.0,接受任意Ip连接,false:监听在127.0.0.1,仅接受本机连接--> | ||
<add key="listenAny" value="true" /> | ||
<!--系统代理端口--> | ||
<add key="proxyPort" value="8827" /> | ||
<!--在控制台输出弹幕--> | ||
<add key="printBarrage" value="true" /> | ||
<!--要在控制台打印的弹幕类型,可以用','隔开 all[全部],1[普通弹幕],2[点赞消息],3[进入直播间],4[关注消息],5[礼物消息],6[统计消息],7[粉丝团消息]--> | ||
<add key="printFilter" value="all" /> | ||
<!--是否启用系统代理,若设置为false 则需要在程序手动指定代理地址 --> | ||
<add key="usedProxy" value="true" /> | ||
<!--开启内置的域名过滤,设置为false会解包所有https请求,cpu占用很高,建议在无法获取弹幕数据时调整 --> | ||
<add key="filterHostName" value="true" /> | ||
<!--已知的弹幕域名列表 ','分隔 用作过滤规则中,凡是webcast开头的域名程序都会自动列入白名单--> | ||
<add key="hostNameFilter" value="" /> | ||
<!--要进行过滤的房间ID,不填代表监听所有,多项使用','分隔,浏览器进入直播间 F12 控制台输入 'window.localStorage.playRoom' 即可快速看到房间ID(不是地址栏中的那个) --> | ||
<add key="roomIds" value="" /> | ||
</appSettings> | ||
<runtime> | ||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<dependentAssembly> | ||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | ||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" /> | ||
</dependentAssembly> | ||
</assemblyBinding> | ||
</runtime> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using BarrageGrab.Modles; | ||
using ColorConsole; | ||
|
||
namespace BarrageGrab | ||
{ | ||
/// <summary> | ||
/// 程序运行时信息 | ||
/// </summary> | ||
public static class AppRuntime | ||
{ | ||
/// <summary> | ||
/// Ws弹幕服务示例 | ||
/// </summary> | ||
public static WsBarrageService WssService { get; private set; } = new WsBarrageService(); | ||
|
||
/// <summary> | ||
/// 程序进程信息 | ||
/// </summary> | ||
public static Process CurrentProcess { get; private set; } = System.Diagnostics.Process.GetCurrentProcess(); | ||
|
||
|
||
static AppRuntime() | ||
{ | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using NLog; | ||
|
||
namespace BarrageGrab | ||
{ | ||
public static class Logger | ||
{ | ||
private static NLog.Config.ISetupBuilder builder = LogManager.Setup().LoadConfigurationFromFile("nlog.config"); | ||
|
||
private static readonly NLog.Logger logger = builder.GetLogger("*"); | ||
|
||
// 记录日志方法 | ||
public static void LogTrace(string message) | ||
{ | ||
logger.Trace(message); | ||
} | ||
|
||
public static void LogDebug(string message) | ||
{ | ||
logger.Debug(message); | ||
} | ||
|
||
public static void LogInfo(string message) | ||
{ | ||
logger.Info(message); | ||
} | ||
|
||
public static void LogWarn(string message) | ||
{ | ||
logger.Warn(message); | ||
} | ||
|
||
public static void LogError(string message) | ||
{ | ||
logger.Error(message); | ||
} | ||
|
||
public static void LogError(Exception ex, string message) | ||
{ | ||
logger.Error(ex, message); | ||
} | ||
|
||
public static void LogFatal(string message) | ||
{ | ||
logger.Fatal(message); | ||
} | ||
|
||
public static void LogFatal(Exception ex, string message) | ||
{ | ||
logger.Fatal(ex, message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace BarrageGrab.Modles | ||
{ | ||
/// <summary> | ||
/// 业务异常 | ||
/// </summary> | ||
public class BusinessExecption : Exception | ||
{ | ||
/// <summary> | ||
/// 错误码 | ||
/// </summary> | ||
public int Code { get; set; } = -1; | ||
|
||
/// <summary> | ||
/// 异常附加数据 | ||
/// </summary> | ||
public object ErrorTarget { get; set; } = null; | ||
|
||
public BusinessExecption() | ||
{ | ||
|
||
} | ||
|
||
public BusinessExecption(string msg) : base(msg) | ||
{ | ||
this.Code = -1; | ||
} | ||
|
||
public BusinessExecption(string msg,object data) : base(msg) | ||
{ | ||
this.ErrorTarget = data; | ||
} | ||
|
||
public BusinessExecption(string msg, int code) : this(msg) | ||
{ | ||
this.Code = code; | ||
} | ||
} | ||
} |
Oops, something went wrong.