Skip to content

Commit

Permalink
修复推荐页直播无法打开
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed Mar 27, 2024
1 parent a2954dd commit 3ad3f2d
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions src/BiliLite.UWP/Services/MessageCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,31 @@ public static async Task<bool> HandelUrl(string url, bool dontGoTo = false)
{
url = await BiliExtensions.GetShortLinkLocation(url);
}



/*
* 直播
* http://live.bilibili.com/live/5619438.html
* http://live.bilibili.com/h5/5619438
* http://live.bilibili.com/5619438
* bilibili://live/5619438
*/

var live = StringExtensions.RegexMatch(url.Replace("h5", "live").Replace("live.bilibili.com", "live").Replace("/", ""), @"live(\d+)");
if (live != "")
{
NavigateToPage(null, new NavigationInfo()
{
icon = Symbol.Video,
page = typeof(LiveDetailPage),
title = "直播间加载中...",
parameters = live,
dontGoTo = dontGoTo,
});
return true;
}

/*
* 视频
* https://www.bilibili.com/video/av3905642
Expand Down Expand Up @@ -265,28 +290,6 @@ await BiliExtensions.BangumiEpidToSid(bangumi),



/*
* 直播
* http://live.bilibili.com/live/5619438.html
* http://live.bilibili.com/h5/5619438
* http://live.bilibili.com/5619438
* bilibili://live/5619438
*/

var live = StringExtensions.RegexMatch(url.Replace("h5", "live").Replace("live.bilibili.com", "live").Replace("/", ""), @"live(\d+)");
if (live != "")
{
NavigateToPage(null, new NavigationInfo()
{
icon = Symbol.Video,
page = typeof(LiveDetailPage),
title = "直播间加载中...",
parameters = live,
dontGoTo = dontGoTo,
});
return true;
}

///*
// * 小视频
// * http://vc.bilibili.com/mobile/detail?vc=1399466&bilifrom=1
Expand Down

0 comments on commit 3ad3f2d

Please sign in to comment.