fix: 该动态不能转发分享(#189)

Fixed #189
This commit is contained in:
shanmite 2022-09-11 17:24:43 +08:00
parent c8e1a328ec
commit 58edd4129c

View File

@ -919,7 +919,8 @@ const bili_client = {
* @return {boolean} isError true * @return {boolean} isError true
*/ */
async shareVideo(uid, aid) { async shareVideo(uid, aid) {
const responseText = await post({ const
responseText = await post({
url: API.DYNAMIC_REPOST_SHARE, url: API.DYNAMIC_REPOST_SHARE,
contents: { contents: {
platform: "pc", platform: "pc",
@ -930,11 +931,16 @@ const bili_client = {
rid: aid, rid: aid,
csrf_token: GlobalVar.get("csrf") csrf_token: GlobalVar.get("csrf")
} }
}); }),
if (/^{"code":0/.test(responseText)) { res = strToJson(responseText);
switch (res.code) {
case 0:
log.info('转发视频', `成功转发视频(av${aid})`); log.info('转发视频', `成功转发视频(av${aid})`);
return false return false
} else { case 1101015:
log.warn('转发视频', `该动态不能转发分享(av${aid})`);
return false
default:
log.error('转发视频', `转发失败\n${responseText}`); log.error('转发视频', `转发失败\n${responseText}`);
return true return true
} }