Skip to content

Commit

Permalink
fix new api (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzsdy committed Mar 1, 2019
1 parent abcf109 commit b5978e6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions BiLiRoku/Bililivelib/Downloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ private async void CommentProvider_OnReceivedComment(object sender, ReceivedComm
{
try
{
//DEBUG: 弹幕显示测试
_mw.AppendLogln("收到弹幕", e.Comment.CommentUser + ": " + e.Comment.CommentText);
//接收到弹幕时的处理。
if (e.Comment.MsgType != MsgTypeEnum.LiveStart)
{
Expand Down
6 changes: 3 additions & 3 deletions BiLiRoku/Bililivelib/PathFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal Task<string> GetTrueUrl(string roomid)
AddInfo("ERROR", "房间号获取错误。");
throw new Exception("No roomid");
}
var apiUrl = "https://api.live.bilibili.com/api/playurl?cid=" + roomid + "&otype=json&quality=0&platform=web";
var apiUrl = "https://api.live.bilibili.com/room/v1/Room/playUrl?cid=" + roomid + "&otype=json&quality=0&platform=web";
SendStat(roomid);
//访问API获取结果
Expand All @@ -98,13 +98,13 @@ internal Task<string> GetTrueUrl(string roomid)
try
{
var jsonResult = JObject.Parse(resultString);
var trueUrl = jsonResult["durl"][0]["url"].ToString();
var trueUrl = jsonResult["data"]["durl"][0]["url"].ToString();
AddInfo("INFO", "地址解析成功:" + trueUrl);
return trueUrl;
}
catch (Exception e)
{
AddInfo("ERROR", "解析XML失败" + e.Message);
AddInfo("ERROR", "视频流地址解析失败" + e.Message);
throw;
}
});
Expand Down
2 changes: 1 addition & 1 deletion BiLiRoku/Commentlib/CommentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace BiliRoku.Commentlib
{
internal class CommentProvider
{
private const int CmtPort = 788;
private const int CmtPort = 2243;
private readonly string _roomid;
private readonly MainWindow _mw;
private bool _connected; //连接情况
Expand Down
4 changes: 2 additions & 2 deletions BiLiRoku/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</TextBox.SelectionBrush>
</TextBox>
<Label x:Name="roomIdTextLabel" Content="房间号:http://live.bilibili.com/" HorizontalAlignment="Left" Margin="10,15,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="roomIdBox" HorizontalAlignment="Left" Height="25" Margin="196,15,0,0" Text="10112" VerticalAlignment="Top" Width="124" VerticalContentAlignment="Center" TextChanged="roomIdBox_TextChanged"/>
<TextBox x:Name="roomIdBox" HorizontalAlignment="Left" Height="25" Margin="196,15,0,0" Text="12564" VerticalAlignment="Top" Width="124" VerticalContentAlignment="Center" TextChanged="roomIdBox_TextChanged"/>
<Label x:Name="savepathTextLabel" Content="保存路径:" HorizontalAlignment="Left" Margin="10,54,0,0" VerticalAlignment="Top" Cursor="Hand" MouseLeftButtonUp="savepathTextLabel_MouseLeftButtonUp"/>
<TextBox x:Name="savepathBox" HorizontalAlignment="Left" Height="25" Margin="80,54,0,0" VerticalAlignment="Top" Width="199" VerticalContentAlignment="Center" IsReadOnly="True" TextChanged="savepathBox_TextChanged"/>
<Button x:Name="openSavepathConfigDialogButton" Content="设置..." HorizontalAlignment="Left" Margin="284,54,0,0" VerticalAlignment="Top" Width="63" Height="25" Click="openSavepathConfigDialogButton_Click"/>
Expand All @@ -39,7 +39,7 @@
<Label Content="录制时间"/>
<Label Content="比特率"/>
<Label Content="传输大小"/>
<Label Content="直播间人数"/>
<Label Content="人气值"/>
</StackPanel>
<StackPanel Height="127" Canvas.Left="73" Width="72">
<Label x:Name="LiveStatus" Content="检测中" HorizontalContentAlignment="Right"/>
Expand Down
8 changes: 4 additions & 4 deletions BiLiRoku/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("BiLiRoku")]
[assembly: AssemblyDescription("bilibili生放送录制")]
[assembly: AssemblyDescription("bilibili直播录制")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Zyzsdy")]
[assembly: AssemblyProduct("BiLiRoku")]
[assembly: AssemblyCopyright("Copyright © Zyzsdy 2015-2017")]
[assembly: AssemblyCopyright("Copyright © Zyzsdy 2015-2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down Expand Up @@ -51,7 +51,7 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]
[assembly: AssemblyVersion("1.5.1.0")]
[assembly: AssemblyFileVersion("1.5.1.0")]
[assembly: Guid("0e57f63c-b0b9-4430-95de-c066caa9cc1e")]

8 changes: 4 additions & 4 deletions BiLiRoku/Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ namespace BiliRoku
[SuppressMessage("ReSharper", "InconsistentNaming")]
internal static class Ver
{
public const string VER = "1.5.0";
public const string DATE = "(2017-11-3)";
public const string DESC = "B站新版对应升级。";
public const string VER = "1.5.1";
public const string DATE = "(2019-3-1)";
public const string DESC = "修改API";
public static readonly string OS_VER = "(" + WinVer.SystemVersion.Major + "." + WinVer.SystemVersion.Minor + "." + WinVer.SystemVersion.Build + ")";
public static readonly string UA = "FeelyBlog/1.1 ([email protected]) BiliRoku/1.5.0 " + OS_VER + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36";
public static readonly string UA = "FeelyBlog/1.1 ([email protected]) BiliRoku/1.5.1 " + OS_VER + " AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36";
}

// 检查更新
Expand Down

0 comments on commit b5978e6

Please sign in to comment.