-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
1,186 additions
and
72 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
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
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,7 +1,7 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Authors>Ray</Authors> | ||
<Version>0.3.2</Version> | ||
<Version>0.4.0</Version> | ||
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn> | ||
</PropertyGroup> | ||
</Project> |
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,3 +1,4 @@ | ||
0 15 * * * dotnet /app/Ray.BiliBiliTool.Console.dll --runTasks=Daily >> /var/log/cron.log | ||
0 22 * * * dotnet /app/Ray.BiliBiliTool.Console.dll --runTasks=LiveLottery >> /var/log/cron.log | ||
7 1 * * * dotnet /app/Ray.BiliBiliTool.Console.dll --runTasks=VipBigPoint >> /var/log/cron.log | ||
5 0 * * * dotnet /app/Ray.BiliBiliTool.Console.dll --runTasks=LiveFansMedal >> /var/log/cron.log |
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
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,9 @@ | ||
#!/usr/bin/env bash | ||
# new Env("bili直播粉丝牌") | ||
# cron 5 0 * * * bili_task_liveFansMedal.sh | ||
. bili_task_base.sh | ||
|
||
cd ./src/Ray.BiliBiliTool.Console | ||
|
||
export Ray_RunTasks=LiveFansMedal && \ | ||
dotnet run --ENVIRONMENT=Production |
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,9 @@ | ||
#!/usr/bin/env bash | ||
# new Env("bili直播粉丝牌[dev先行版]") | ||
# cron 5 0 * * * bili_dev_task_liveFansMedal.sh | ||
. bili_dev_task_base.sh | ||
|
||
cd ./src/Ray.BiliBiliTool.Console | ||
|
||
export Ray_RunTasks=LiveFansMedal && \ | ||
dotnet run --ENVIRONMENT=Production |
18 changes: 18 additions & 0 deletions
18
src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Dtos/GetSpaceInfoResponse.cs
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,18 @@ | ||
namespace Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos | ||
{ | ||
public class GetSpaceInfoResponse | ||
{ | ||
public int Mid { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public SpaceLiveRoomInfoDto Live_room { get; set; } | ||
} | ||
|
||
public class SpaceLiveRoomInfoDto | ||
{ | ||
public string Title { get; set; } | ||
|
||
public int Roomid { get; set; } | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Dtos/Live/EnterRoomRequest.cs
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,56 @@ | ||
using Newtonsoft.Json; | ||
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Web; | ||
|
||
namespace Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos.Live | ||
{ | ||
public class EnterRoomRequest | ||
{ | ||
public EnterRoomRequest( | ||
int roomId, | ||
int parentId, | ||
int areaID, | ||
int seqNumber, // 心跳包编号 | ||
long timestamp, | ||
string userAgent, | ||
string csrf, | ||
int ruid, | ||
string device) | ||
{ | ||
Id = JsonConvert.SerializeObject(new[] { parentId, areaID, seqNumber, roomId }); | ||
Ts = timestamp; | ||
Ua = userAgent; | ||
Csrf = csrf; | ||
Ruid = ruid; | ||
|
||
Is_patch = 0; | ||
Heart_beat = "[]"; | ||
Visit_id = ""; | ||
Device = device; | ||
} | ||
public string Id { get; set; } | ||
|
||
public int Ruid { get; set; } | ||
|
||
public long Ts { get; set; } | ||
|
||
public int Is_patch { get; set; } | ||
|
||
public string Heart_beat { get; set; } | ||
|
||
public string Ua { get; set; } | ||
|
||
public string Csrf_token => Csrf; | ||
|
||
public string Csrf { get; set; } | ||
|
||
public string Visit_id { get; set; } | ||
|
||
public string Device { get; set; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Dtos/Live/GetLiveRoomInfoResponse.cs
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,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos.Live | ||
{ | ||
public class GetLiveRoomInfoResponse | ||
{ | ||
public int Room_id { get; set; } | ||
|
||
public int Area_id { get; set; } | ||
|
||
public int Parent_area_id { get; set; } | ||
|
||
public int Uid { get; set; } | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Dtos/Live/HeartBeatRequest.cs
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,76 @@ | ||
using Ray.BiliBiliTool.Agent.BiliBiliAgent.Utils; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
|
||
namespace Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos.Live | ||
{ | ||
public class HeartBeatRequest | ||
{ | ||
public HeartBeatRequest( | ||
int roomId, | ||
int parentId, | ||
int areaID, | ||
int seqNumber, // 心跳包编号 | ||
string buvid, // cookie['LIVE_BUVID'] | ||
long timestamp, | ||
long ets, // 由后端返回的 timestamp | ||
string userAgent, | ||
ICollection<int> secretRule, | ||
string secretKey, | ||
string csrf, | ||
string uuid, | ||
string device) | ||
{ | ||
Id = JsonSerializer.Serialize(new[] { parentId, areaID, seqNumber, roomId }); | ||
Ets = ets; | ||
Benchmark = secretKey; | ||
Time = 60; | ||
Ts = timestamp; | ||
Ua = userAgent; | ||
Csrf = csrf; | ||
Device = device; | ||
|
||
// 构造哈希值 | ||
var json = new | ||
{ | ||
platform = "web", | ||
parent_id = parentId, | ||
area_id = areaID, | ||
seq_id = seqNumber, | ||
room_id = roomId, | ||
buvid, | ||
uuid, | ||
ets, | ||
time = 60, | ||
ts = timestamp, | ||
}; | ||
string jsonString = JsonSerializer.Serialize(json); | ||
this.S = LiveHeartBeatCrypto.Sypder(jsonString, secretRule, secretKey); | ||
|
||
this.Visit_id = ""; | ||
} | ||
|
||
public string S { get; set; } | ||
|
||
public string Id { get; set; } | ||
|
||
public long Ets { get; set; } | ||
|
||
public string Benchmark { get; set; } | ||
|
||
public long Time { get; set; } | ||
|
||
public long Ts { get; set; } | ||
|
||
public string Ua { get; set; } | ||
|
||
public string Csrf_token => Csrf; | ||
|
||
public string Csrf { get; set; } | ||
|
||
public string Visit_id { get; set; } | ||
|
||
public string Device { get; } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Dtos/Live/HeartBeatResponse.cs
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,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Ray.BiliBiliTool.Agent.BiliBiliAgent.Dtos.Live | ||
{ | ||
public class HeartBeatResponse | ||
{ | ||
public int Heartbeat_interval { get; set; } | ||
|
||
public string Secret_key { get; set; } | ||
|
||
public List<int> Secret_rule { get; set;} | ||
|
||
public long Timestamp { get; set; } | ||
} | ||
} |
Oops, something went wrong.