-
Notifications
You must be signed in to change notification settings - Fork 47
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
112 changed files
with
1,226 additions
and
734 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Bilibili.AspNetCore.Apis/Bilibili.AspNetCore.Apis.csproj
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,20 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>disable</ImplicitUsings> | ||
<Nullable>disable</Nullable> | ||
<Version>4.0.2</Version> | ||
<Description>Bilibili API封装。</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" /> | ||
<PackageReference Include="SkiaSharp.QrCode" Version="0.7.0" /> | ||
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.8" /> | ||
</ItemGroup> | ||
|
||
</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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Bilibili.AspNetCore.Apis.Constants | ||
{ | ||
class CacheKeyConstant | ||
{ | ||
public const string COOKIE_KEY = "COOKIE_KEY"; | ||
|
||
public const string LOGIN_STATUS_CACHE_KEY = "PAGE_STATUS_CACHE_KEY"; | ||
} | ||
} |
14 changes: 6 additions & 8 deletions
14
...dencyInjection/RegisteBilibiliServices.cs → ...ependencyInjection/RegisteBilibiliApis.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
2 changes: 1 addition & 1 deletion
2
...toLiver/Exceptions/ApiRequestException.cs → ...re.Apis/Exceptions/ApiRequestException.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
6 changes: 1 addition & 5 deletions
6
...liAutoLiver/Exceptions/CookieException.cs → ...etCore.Apis/Exceptions/CookieException.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
6 changes: 1 addition & 5 deletions
6
...iver/Exceptions/CookieExpiredException.cs → ...Apis/Exceptions/CookieExpiredException.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
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
6 changes: 3 additions & 3 deletions
6
...ices/Interface/IBilibiliLiveApiService.cs → ...Apis/Interface/IBilibiliLiveApiService.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
8 changes: 4 additions & 4 deletions
8
.../Services/Interface/IHttpClientService.cs → ...Core.Apis/Interface/IHttpClientService.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
2 changes: 1 addition & 1 deletion
2
...ibiliAutoLiver/Models/Base/ResultModel.cs → ...spNetCore.Apis/Models/Base/ResultModel.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
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,8 @@ | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class ConfirmRefreshModel | ||
{ | ||
public string csrf { get; set; } | ||
public string refresh_token { get; set; } | ||
} | ||
} |
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 @@ | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class CookieInfo | ||
{ | ||
public bool refresh { get; set; } | ||
|
||
public long timestamp { get; set; } | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...ibiliAutoLiver/Models/Enums/BodyFormat.cs → ...spNetCore.Apis/Models/Enums/BodyFormat.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
8 changes: 1 addition & 7 deletions
8
src/BilibiliAutoLiver/Models/HeartBeat.cs → ...ibili.AspNetCore.Apis/Models/HeartBeat.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
2 changes: 1 addition & 1 deletion
2
src/BilibiliAutoLiver/Models/LiveAreaItem.cs → ...li.AspNetCore.Apis/Models/LiveAreaItem.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
2 changes: 1 addition & 1 deletion
2
src/BilibiliAutoLiver/Models/LiveRoomInfo.cs → ...li.AspNetCore.Apis/Models/LiveRoomInfo.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace BilibiliAutoLiver.Models | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class LiveRoomInfo | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
...BilibiliAutoLiver/Models/ProtocolsItem.cs → ...i.AspNetCore.Apis/Models/ProtocolsItem.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace BilibiliAutoLiver.Models | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class ProtocolsItem | ||
{ | ||
|
10 changes: 2 additions & 8 deletions
10
...iAutoLiver/Models/LoginStatusCacheInfo.cs → ...pNetCore.Apis/Models/QrCodeLoginStatus.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
8 changes: 1 addition & 7 deletions
8
...ibiliAutoLiver/Models/QrCodeScanResult.cs → ...spNetCore.Apis/Models/QrCodeScanResult.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
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,25 @@ | ||
using System; | ||
using System.IO; | ||
using SkiaSharp; | ||
using SkiaSharp.QrCode.Image; | ||
|
||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class QrCodeUrl | ||
{ | ||
public string qrcode_key { get; set; } | ||
|
||
public string url { get; set; } | ||
|
||
public byte[] GetBytes() | ||
{ | ||
if (string.IsNullOrWhiteSpace(this.url)) throw new ArgumentNullException("url"); | ||
var qrCode = new SkiaSharp.QrCode.Image.QrCode(this.url, new Vector2Slim(512, 512), SKEncodedImageFormat.Png); | ||
using (MemoryStream ms = new MemoryStream()) | ||
{ | ||
qrCode.GenerateImage(ms, true, SkiaSharp.QrCode.ECCLevel.M); | ||
return ms.ToArray(); | ||
} | ||
} | ||
} | ||
} |
8 changes: 1 addition & 7 deletions
8
...iliAutoLiver/Models/RefreshCookieModel.cs → ...NetCore.Apis/Models/RefreshCookieModel.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
8 changes: 1 addition & 7 deletions
8
...liAutoLiver/Models/RefreshCookieResult.cs → ...etCore.Apis/Models/RefreshCookieResult.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
8 changes: 2 additions & 6 deletions
8
src/BilibiliAutoLiver/Models/RoomPlayInfo.cs → ...li.AspNetCore.Apis/Models/RoomPlayInfo.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
2 changes: 1 addition & 1 deletion
2
src/BilibiliAutoLiver/Models/Rtmp.cs → src/Bilibili.AspNetCore.Apis/Models/Rtmp.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace BilibiliAutoLiver.Models | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class Rtmp | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
...BilibiliAutoLiver/Models/StartLiveInfo.cs → ...i.AspNetCore.Apis/Models/StartLiveInfo.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
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 @@ | ||
namespace Bilibili.AspNetCore.Apis.Models | ||
{ | ||
public class StopLiveInfo | ||
{ | ||
public int change { get; set; } | ||
|
||
public string status { get; set; } | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/BilibiliAutoLiver/Models/UserInfo.cs → ...libili.AspNetCore.Apis/Models/UserInfo.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
Oops, something went wrong.