feat(onebot): add upload_video_to_qun_album
Group albums already list videos, but upload only accepted images. Add a dedicated video action that extracts a cover and returns the new video id. Fixed #331
This commit is contained in:
6 files changed
+769
-6
No files matched your search
@@ -17,7 +17,7 @@ import type {
|
||||
MediaInfo,
|
||||
UrlInfo,
|
||||
} from '@snowluma/proto-defs/oidb-actions/group-album';
|
||||
import { uploadImageToGroupAlbum } from '@snowluma/protocol/web/group-album';
|
||||
import { uploadImageToGroupAlbum, uploadVideoToGroupAlbum } from '@snowluma/protocol/web/group-album';
|
||||
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
|
||||
import type { BridgeContext } from '../bridge-context';
|
||||
|
||||
@@ -262,6 +262,13 @@ export class GroupAlbumApi {
|
||||
await uploadImageToGroupAlbum(cookieObject, groupCode, albumId, albumName, filePath, uin);
|
||||
}
|
||||
|
||||
async uploadVideo(groupId: number, albumId: string, albumName: string, filePath: string): Promise<{ id: string }> {
|
||||
const groupCode = groupId.toString();
|
||||
const uin = this.ctx.identity.uin;
|
||||
const cookieObject = await this.ctx.apis.web.getCookies('qzone.qq.com');
|
||||
return uploadVideoToGroupAlbum(cookieObject, groupCode, albumId, albumName, filePath, uin);
|
||||
}
|
||||
|
||||
async getMediaList(groupId: number, albumId: string, attachInfo = ''): Promise<GroupAlbumMediaResult> {
|
||||
const traceId = `_${Date.now()}_${Math.floor(Math.random() * 100000)}`;
|
||||
|
||||
|
||||
Reference in new issue
Block a user