mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 05:47:11 +00:00
fix: 使用icqq发送视频
This commit is contained in:
parent
4cbca97c56
commit
0cdd2be29a
3 changed files with 25 additions and 32 deletions
|
|
@ -1055,10 +1055,14 @@ export async function getOrDownloadFile (destPath, url, ignoreCertificateError =
|
|||
* @param destPath 目标路径,如received/abc.pdf. 目前如果文件名重复会覆盖。
|
||||
* @param absolute 是否是绝对路径,默认为false,此时拼接在data/chatgpt下
|
||||
* @param ignoreCertificateError 忽略证书错误
|
||||
* @param headers
|
||||
* @returns {Promise<string>} 最终下载文件的存储位置
|
||||
*/
|
||||
export async function downloadFile (url, destPath, absolute = false, ignoreCertificateError = true) {
|
||||
export async function downloadFile (url, destPath, absolute = false, ignoreCertificateError = true, headers) {
|
||||
let init = {}
|
||||
if (headers) {
|
||||
init.headers = headers
|
||||
}
|
||||
if (ignoreCertificateError && url.startsWith('https')) {
|
||||
init.agent = new https.Agent({
|
||||
rejectUnauthorized: !ignoreCertificateError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue