Skip to content

Commit

Permalink
Merge branch 'release/0.4.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
RayWangQvQ committed Feb 9, 2023
2 parents a2803da + 31bc73e commit 5406f20
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docker/scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo -e "=>完成\n"
echo "[step 2/4]配置cron定时任务"
echo "SHELL=/bin/bash" >$CRON_FILE
echo "BASH_ENV=/etc/cron.env" >>$CRON_FILE
if [ -z "$Ray_LiveLotteryTaskConfig__Cron$Ray_UnfollowBatchedTaskConfig__Cron$Ray_VipBigPointConfig__Cron$Ray_LiveFansMedalTaskConfig__Cron" ]; then
if [ -z "$Ray_DailyTaskConfig__Cron$Ray_LiveLotteryTaskConfig__Cron$Ray_UnfollowBatchedTaskConfig__Cron$Ray_VipBigPointConfig__Cron$Ray_LiveFansMedalTaskConfig__Cron" ]; then
echo "=>使用默认的定时任务配置"
cat /app/scripts/crontab >>$CRON_FILE
else
Expand Down
26 changes: 14 additions & 12 deletions src/Ray.BiliBiliTool.Agent/BiliBiliAgent/Interfaces/IVideoApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ public interface IVideoApi : IBiliBiliApi
[HttpGet("/x/web-interface/archive/coins")]
Task<BiliApiResponse<DonatedCoinsForVideo>> GetDonatedCoinsForVideo(GetAlreadyDonatedCoinsRequest request);
#endregion

/// <summary>
/// 搜索指定Up的视频列表
/// </summary>
/// <param name="upId"></param>
/// <param name="pageSize">[1,100]验证不通过接口会报异常</param>
/// <param name="pageNumber"></param>
/// <param name="keyword"></param>
/// <returns></returns>
[Header("Referer", "https://www.bilibili.com/")]
[Header("Origin", "https://space.bilibili.com")]
[HttpGet("/x/space/wbi/arc/search?mid={upId}&ps={pageSize}&tid=0&pn={pageNumber}&keyword={keyword}&order=pubdate&jsonp=jsonp")]
Task<BiliApiResponse<SearchUpVideosResponse>> SearchVideosByUpId(long upId, int pageSize = 30, int pageNumber = 1, string keyword = "");

}

/// <summary>
Expand Down Expand Up @@ -95,18 +109,6 @@ public interface IVideoWithoutCookieApi : IVideoApi
[HttpGet("/x/web-interface/ranking/v2?rid=0&type=all")]
Task<BiliApiResponse<Ranking>> GetRegionRankingVideosV2();

/// <summary>
/// 搜索指定Up的视频列表
/// </summary>
/// <param name="upId"></param>
/// <param name="pageSize">[1,100]验证不通过接口会报异常</param>
/// <param name="pageNumber"></param>
/// <param name="keyword"></param>
/// <returns></returns>
[Header("Referer", "https://www.bilibili.com/")]
[Header("Origin", "https://space.bilibili.com")]
[HttpGet("/x/space/arc/search?mid={upId}&ps={pageSize}&tid=0&pn={pageNumber}&keyword={keyword}&order=pubdate&jsonp=jsonp")]
Task<BiliApiResponse<SearchUpVideosResponse>> SearchVideosByUpId(long upId, int pageSize = 30, int pageNumber = 1, string keyword = "");

}
}
4 changes: 2 additions & 2 deletions src/Ray.BiliBiliTool.DomainService/VideoDomainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public UpVideoInfo GetRandomVideoOfUp(long upId, int total)
if (total <= 0) return null;

int pageNum = new Random().Next(1, total + 1);
BiliApiResponse<SearchUpVideosResponse> re = _videoWithoutCookieApi.SearchVideosByUpId(upId, 1, pageNum).GetAwaiter().GetResult();
BiliApiResponse<SearchUpVideosResponse> re = _videoApi.SearchVideosByUpId(upId, 1, pageNum).GetAwaiter().GetResult();

if (re.Code != 0)
{
Expand All @@ -94,7 +94,7 @@ public UpVideoInfo GetRandomVideoOfUp(long upId, int total)
/// <returns></returns>
public int GetVideoCountOfUp(long upId)
{
BiliApiResponse<SearchUpVideosResponse> re = _videoWithoutCookieApi.SearchVideosByUpId(upId)
BiliApiResponse<SearchUpVideosResponse> re = _videoApi.SearchVideosByUpId(upId)
.GetAwaiter().GetResult();
if (re.Code != 0)
{
Expand Down

0 comments on commit 5406f20

Please sign in to comment.