mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add more logging to media
This commit is contained in:
@@ -222,10 +222,13 @@ export const getGotStream = async(url: string | URL, options: Options & { isStre
|
||||
export const encryptedStream = async(
|
||||
media: WAMediaUpload,
|
||||
mediaType: MediaType,
|
||||
saveOriginalFileIfRequired = true
|
||||
saveOriginalFileIfRequired = true,
|
||||
logger?: Logger
|
||||
) => {
|
||||
const { stream, type } = await getStream(media)
|
||||
|
||||
logger?.debug('fetched media stream')
|
||||
|
||||
const mediaKey = Crypto.randomBytes(32)
|
||||
const {cipherKey, iv, macKey} = getMediaKeys(mediaKey, mediaType)
|
||||
// random name
|
||||
@@ -277,6 +280,8 @@ export const encryptedStream = async(
|
||||
encWriteStream.push(null)
|
||||
|
||||
writeStream && writeStream.end()
|
||||
|
||||
logger?.debug('encrypted data successfully')
|
||||
|
||||
return {
|
||||
mediaKey,
|
||||
|
||||
Reference in New Issue
Block a user