Skip to content

Commit

Permalink
Merge pull request #3 from Executor-Cheng/dev/1.0.3
Browse files Browse the repository at this point in the history
更新至1.0.3
  • Loading branch information
Executor-Cheng authored Apr 23, 2023
2 parents 68f420a + 3ec785f commit e7dcd17
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
24 changes: 12 additions & 12 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0-windows10.0.17763.0;net5.0-windows10.0.17763.0;netframework461-windows10.0.17763.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<PropertyGroup>
<TargetFrameworks>net7.0-windows10.0.17763.0;net6.0-windows10.0.17763.0;net5.0-windows10.0.17763.0;netframework461-windows10.0.17763.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>

<Version>1.0.2.0</Version>
<AssemblyVersion>1.0.2.0</AssemblyVersion>
<FileVersion>1.0.2.0</FileVersion>
<PackageVersion>1.0.2.0</PackageVersion>
</PropertyGroup>
<Version>1.0.3.0</Version>
<AssemblyVersion>1.0.3.0</AssemblyVersion>
<FileVersion>1.0.3.0</FileVersion>
<PackageVersion>1.0.3.0</PackageVersion>
</PropertyGroup>
</Project>
14 changes: 7 additions & 7 deletions src/BililiveNotification/Apis/BiliApis.GetUserInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using BililiveNotification.Models;
using BililiveNotification.Models;
using Executorlibs.Shared.Exceptions;
using Executorlibs.Shared.Extensions;
using System;
Expand All @@ -13,18 +13,18 @@ public static partial class BiliApis
{
public static async Task<UserInfo> GetUserInfoAsync(HttpClient client, int userId, CancellationToken token = default)
{
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Get, $"https://api.bilibili.com/x/space/acc/info?mid={userId}&jsonp=jsonp");
HttpRequestMessage req = new HttpRequestMessage(HttpMethod.Get, $"https://api.bilibili.com/x/web-interface/card?mid={userId}");
req.Headers.Accept.ParseAdd("*/*");
req.Headers.Add("Origin", "https://live.bilibili.com");
req.Headers.Referrer = new Uri("https://live.bilibili.com/");
using JsonDocument j = await client.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, token).GetJsonAsync(token);
req.Headers.Add("Origin", "https://www.bilibili.com");
req.Headers.Referrer = new Uri("https://www.bilibili.com/");
using JsonDocument j = await client.SendAsync(req, token).GetJsonAsync(token);
JsonElement root = j.RootElement;
if (root.GetProperty("code").GetInt32() != 0)
{
throw new UnknownResponseException(in root);
}
JsonElement data = root.GetProperty("data");
return new UserInfo(data.GetProperty("name").GetString()!, userId, data.GetProperty("face").GetString()!);
JsonElement card = root.GetProperty("data").GetProperty("card");
return new UserInfo(card.GetProperty("name").GetString()!, userId, card.GetProperty("face").GetString()!);
}
}
}
19 changes: 13 additions & 6 deletions src/BililiveNotification/BililiveNotification.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Executorlibs.Bilibili.Protocol" Version="1.2.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.0" />
<PackageReference Include="Executorlibs.Bilibili.Protocol" Version="1.5.0" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0-windows10.0.17763.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.17763.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-rc.2.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows10.0.17763.0' or '$(TargetFramework)' == 'netframework461-windows10.0.17763.0'">
Expand Down

0 comments on commit e7dcd17

Please sign in to comment.