release: v2.4.9

This commit is contained in:
手瓜一十雪 2024-09-12 19:47:57 +08:00
parent 46e56ac726
commit edf80775b7
7 changed files with 15 additions and 6 deletions

View File

@ -4,7 +4,7 @@
"name": "NapCatQQ", "name": "NapCatQQ",
"slug": "NapCat.Framework", "slug": "NapCat.Framework",
"description": "高性能的 OneBot 11 协议实现", "description": "高性能的 OneBot 11 协议实现",
"version": "2.4.8", "version": "2.4.9",
"icon": "./logo.png", "icon": "./logo.png",
"authors": [ "authors": [
{ {

View File

@ -2,7 +2,7 @@
"name": "napcat", "name": "napcat",
"private": true, "private": true,
"type": "module", "type": "module",
"version": "2.4.8", "version": "2.4.9",
"scripts": { "scripts": {
"build:framework": "vite build --mode framework", "build:framework": "vite build --mode framework",
"build:shell": "vite build --mode shell", "build:shell": "vite build --mode shell",

View File

@ -128,6 +128,7 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi
let url: string; let url: string;
let headers: Record<string, string> = { let headers: Record<string, string> = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36',
'referer': typeof options === 'string' ? options : options.url,
}; };
if (typeof options === 'string') { if (typeof options === 'string') {
url = options; url = options;

View File

@ -1 +1 @@
export const napCatVersion = '2.4.8'; export const napCatVersion = '2.4.9';

View File

@ -147,7 +147,15 @@ export class NTQQFileApi {
} catch (e) { } catch (e) {
logger.logError('获取视频信息失败,将使用默认值', e); logger.logError('获取视频信息失败,将使用默认值', e);
} }
const newFilePath = filePath + '.mp4';
let fileExt = 'mp4'
try {
let tempExt = (await fileType.fileTypeFromFile(filePath))?.ext;
if (tempExt) fileExt = tempExt;
} catch (e) {
this.context.logger.logError('获取文件类型失败', e);
}
const newFilePath = filePath + '.'+fileExt;
fs.copyFileSync(filePath, newFilePath); fs.copyFileSync(filePath, newFilePath);
context.deleteAfterSentFiles.push(newFilePath); context.deleteAfterSentFiles.push(newFilePath);
filePath = newFilePath; filePath = newFilePath;

View File

@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) {
SettingItem( SettingItem(
'<span id="napcat-update-title">Napcat</span>', '<span id="napcat-update-title">Napcat</span>',
undefined, undefined,
SettingButton('V2.4.8', 'napcat-update-button', 'secondary'), SettingButton('V2.4.9', 'napcat-update-button', 'secondary'),
), ),
]), ]),
SettingList([ SettingList([

View File

@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) {
SettingItem( SettingItem(
'<span id="napcat-update-title">Napcat</span>', '<span id="napcat-update-title">Napcat</span>',
void 0, void 0,
SettingButton("V2.4.8", "napcat-update-button", "secondary") SettingButton("V2.4.9", "napcat-update-button", "secondary")
) )
]), ]),
SettingList([ SettingList([