mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-16 13:01:14 +00:00
fix: #503
This commit is contained in:
parent
8c164910f6
commit
8a61f5a03f
@ -175,14 +175,18 @@ export class NTQQFileApi {
|
|||||||
const thumbPath = pathLib.join(thumb, thumbFileName);
|
const thumbPath = pathLib.join(thumb, thumbFileName);
|
||||||
ffmpeg(filePath)
|
ffmpeg(filePath)
|
||||||
.on('error', (err) => {
|
.on('error', (err) => {
|
||||||
logger.logDebug('获取视频封面失败,使用默认封面', err);
|
try {
|
||||||
if (diyThumbPath) {
|
logger.logDebug('获取视频封面失败,使用默认封面', err);
|
||||||
fsPromises.copyFile(diyThumbPath, thumbPath).then(() => {
|
if (diyThumbPath) {
|
||||||
|
fsPromises.copyFile(diyThumbPath, thumbPath).then(() => {
|
||||||
|
resolve(thumbPath);
|
||||||
|
}).catch(reject);
|
||||||
|
} else {
|
||||||
|
fs.writeFileSync(thumbPath, Buffer.from(defaultVideoThumbB64, 'base64'));
|
||||||
resolve(thumbPath);
|
resolve(thumbPath);
|
||||||
}).catch(reject);
|
}
|
||||||
} else {
|
} catch (error) {
|
||||||
fs.writeFileSync(thumbPath, Buffer.from(defaultVideoThumbB64, 'base64'));
|
logger.logError.bind(logger)('获取视频封面失败,使用默认封面失败', error);
|
||||||
resolve(thumbPath);
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.screenshots({
|
.screenshots({
|
||||||
|
Loading…
Reference in New Issue
Block a user