Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] media download 403 error #1108

Open
starksemihyarar opened this issue Oct 31, 2024 · 4 comments
Open

[BUG] media download 403 error #1108

starksemihyarar opened this issue Oct 31, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@starksemihyarar
Copy link

Describe the bug
I am testing with sending about 13-20 image to baileys client, ı got receive 403 for some media downloads

To Reproduce
Steps to reproduce the behavior:

  1. sending 13 images to baileys client whatsapp number
  2. console.log for download media interface

Expected behavior
download and access all media

`
conn.ev.on("messages.upsert", async msg => {
try {
if (msg.type === "notify") {

            for (const m of msg.messages) {
                var full_file_name = null
                const messageType = Object.keys (m.message)[0]

                if (messageType !== 'conversation') {

                    // download the message
                    try {
                        const buffer = await downloadMediaMessage(
                            m,
                            'buffer',
                            { },
                            {
                                _0x1dc0c3,
                                // pass this so that baileys can request a reupload of media
                                // that has been deleted
                                reuploadRequest:  conn.updateMediaMessage
                            }
                        )

                    }catch (e) {
                        console.log(e.message)
                    }

                    const filename = "wpclientdownload_pn_" + m.key.remoteJid + "_" + m.key.id +"_"+ generateRandomString(10)
                    const extension = m.message[messageType].mimetype.split("/")
                    full_file_name = filename+'.'+extension[1].split(";")[0]
                    await writeFile('./public/metocrm/'+full_file_name, buffer)
                }
                //#END - MEDIA
              
            }
        }

    } catch (e) { //console.log("ERROR",e)
         }
});

`

output
`
Request failed with status code 403
Request failed with status code 403
Request failed with status code 403

`

@starksemihyarar starksemihyarar added the bug Something isn't working label Oct 31, 2024
@nekuro201
Copy link

Same here

@starksemihyarar
Copy link
Author

@PurpShell could u help ?

@lucasdoctype
Copy link

Same here , I've noticed this happens mostly with PDF files.

@PurpShell
Copy link
Collaborator

Looking into this right this very moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants