Skip to content

Commit

Permalink
fix bangumi parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Responsitories committed Nov 12, 2023
1 parent 2c3c101 commit 1d29a83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions BBDown.Core/AppHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ public static async Task<string> DoReqAsync(string aid, string cid, string epId,

var headers = GetHeader(appkey);
LogDebug("App-Req-Headers: {0}", JsonSerializer.Serialize(headers, JsonContext.Default.DictionaryStringString));
byte[] body, data;
byte[] data;
// 只有pgc接口才有配音和片头尾信息
if (bangumi)
{
body = GetPayload(Convert.ToInt64(epId), Convert.ToInt64(cid), Convert.ToInt64(qn), GetVideoCodeType(encoding));
if (!(string.IsNullOrEmpty(encoding) || encoding == "HEVC"))
LogWarn("APP的番剧不支持 HEVC 以外的编码");
var body = GetPayload(Convert.ToInt64(epId), Convert.ToInt64(cid), Convert.ToInt64(qn), PlayViewReq.Types.CodeType.Code265);
data = await GetPostResponseAsync(API2, body, headers);
}
else
{
body = GetPayload(Convert.ToInt64(aid), Convert.ToInt64(cid), Convert.ToInt64(qn), GetVideoCodeType(encoding));
var body = GetPayload(Convert.ToInt64(aid), Convert.ToInt64(cid), Convert.ToInt64(qn), GetVideoCodeType(encoding));
data = await GetPostResponseAsync(API, body, headers);
}
var resp = new MessageParser<PlayViewReply>(() => new PlayViewReply()).ParseFrom(ReadMessage(data));
Expand Down

0 comments on commit 1d29a83

Please sign in to comment.