You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked and am using the latest version of the library.
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Business account
Mode
My own code
Current Behavior
It's returning this error:
fetch(1/1): Attempting to send media 1 of type mp4 from hentai_gif
Sending "A fun gathering " as sendFile() from E:\AmecaCore\media\GetReddit\MP4\Da_Darius_1733273220.mp4
sendVideoAsGif: Received data:
{
"type": "mp4",
"filePath": "E:\AmecaCore\media\GetReddit\MP4\Da_Darius_1733273220.mp4",
"source": "hentai_gif",
"title": "A fun gathering ",
"author": "Da_Darius"
}
Error on first try to SendVideoAsGif([email protected],
Path: E:\AmecaCore\media\GetRedditMP4\Da_Darius_1733273220.mp4
SendMP4Results = null a: a
at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:388:56)
at async ExecutionContext.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:275:16)
at async IsolatedWorld.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\IsolatedWorld.js:100:16)
at async CdpFrame.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:341:20)
at async CdpPage.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:807:20)
Code: (Snippits)
One part:
for (let index = 0; index < maxSources; index++) {
await sleep(2500);
progressLog(`fetch(${index}/${maxSources})`, `mediaQueue = ${JSON.stringify(mediaQueue, null, 2)}`);
console.log(`Processed ${index} of ${maxSources}`);
if (index < maxSources) {
const source = sources[index];
progressLog(`fetch(${source} ${index}/${maxSources})`, `Processing source ${index} of ${maxSources}: ${source}`);
try {
const media = await getMedia(source); // Haal de media op met await
progressLog(`fetch(${source} ${index}/${maxSources})`, `media? ${media ? true : false}`);
let filePath
if (media) {
progressLog(`fetch(${source} ${index}/${maxSources})`, `Entered if (media) {`);
const {
mediaUrl: videoUrl, // De URL van de media
mediaType: mediaType, // Type van de media ('image' of 'gif')
author: videoAuthor, // Auteur van de media
title: videoTitle, // Titel van de media
description: videoDescription, // Beschrijving van de media
upvotes: videoUpvotes, // Aantal upvotes
downvotes: videoDownvotes, // Aantal downvotes
numComments: videoNumComments, // Aantal reacties
postUrl: videoPostUrl // URL naar de Reddit post
} = media; // Haal het eerste object uit de media
progressLog(`fetch(${source} ${index}/${maxSources})`, `Fetched media-data = ${JSON.stringify(media)}`);
progressLog(`fetch(${source} ${index}/${maxSources})`, `media.mediaType = ${media.mediaType}\nmediaType = ${mediaType}`);
if (mediaType === 'gif') {
progressLog(`fetch(${source} ${index}/${maxSources})`, `Entered if (mediaType === 'gif')`);
const {
outputFilePath, // Path to the compressed video
} = await DownloadVideo(media.mediaUrl, `E:/AmecaCore/media/GetReddit/MP4/`, videoAuthor, videoTitle)
await waitForPath(outputFilePath);
await sleep(1000)
progressLog(`fetch(${source} ${index}/${maxSources})`, `Adding the following to mediaQueue: \ntype = mp4\nfilePath = ${outputFilePath}\nsource: ${source}`);
mediaQueue.push({
type: 'mp4',
filePath: outputFilePath,
source: source,
title: videoTitle,
author: videoAuthor,
});
Another bit
for (const media of mediaQueue) {
await sleep(250)
if (logs) progressLog(`fetch(${sentFilesCount}/${totalMedia})`, `Attempting to send media ${sentFilesCount} of type ${media.type} from ${media.source}`)
try {
if (media.type === 'mp4') {
let SendMP4Results = null
try {
if (logs) console.log(`${colors.whiteBright.bold(`Sending`)} "${media.title}" ${colors.whiteBright.bold(`as sendFile()`)} from ${media.filePath}`);
console.log(`sendVideoAsGif: Received data:\n${JSON.stringify(media, null, 2)}`)
const messageText = `\`#${sentFilesCount}\` *r/${media.source}* ${media.title}${isTVACommunity || SilentMode ? '' : '\n\nVia Bot-Ameca: https://www.tva-community.chat/'}`;
SendMP4Results = await Client.sendVideoAsGif(ChatID, media.filePath, `${media.title}.mp4`, messageText);
if (logs) console.log(`${colors.whiteBright.bold(`Successfully sent`)} "${media.filePath}" ${colors.whiteBright.bold(`as sendVideoAsGif()`)}`);
fs.unlinkSync(media.filePath);
} catch (error) {
console.error(`Error on first try to SendVideoAsGif(${ChatID}, \nPath: ${media.filePath}\nSendMP4Results = ${SendMP4Results}`, error)
}
}
Are you using the latest version of the library?
What type of session are you experiencing this issue on?
Multi-device and I have set multiDevice to true in my config OR am using the --multi-device flag
What type of host account are you experiencing this issue on?
Business account
Mode
My own code
Current Behavior
It's returning this error:
fetch(1/1): Attempting to send media 1 of type mp4 from hentai_gif
Sending "A fun gathering " as sendFile() from E:\AmecaCore\media\GetReddit\MP4\Da_Darius_1733273220.mp4
sendVideoAsGif: Received data:
{
"type": "mp4",
"filePath": "E:\AmecaCore\media\GetReddit\MP4\Da_Darius_1733273220.mp4",
"source": "hentai_gif",
"title": "A fun gathering ",
"author": "Da_Darius"
}
Error on first try to SendVideoAsGif([email protected],
Path: E:\AmecaCore\media\GetRedditMP4\Da_Darius_1733273220.mp4
SendMP4Results = null a: a
at #evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:388:56)
at async ExecutionContext.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:275:16)
at async IsolatedWorld.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\IsolatedWorld.js:100:16)
at async CdpFrame.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Frame.js:341:20)
at async CdpPage.evaluate (E:\AmecaCore\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:807:20)
Code: (Snippits)
One part:
Another bit
Expected Behavior
Expected it to send the MP4-file as a GIF...
Steps To Reproduce
Check code
create() code OR full CLI command + CONFIG
No response
DEBUG INFO
Environment
Screenshots/Logs
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: