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

Error: Status code: 400 with HTTP IP proxy #207

Open
nezort11 opened this issue Feb 27, 2025 · 0 comments
Open

Error: Status code: 400 with HTTP IP proxy #207

nezort11 opened this issue Feb 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@nezort11
Copy link

nezort11 commented Feb 27, 2025

Describe the bug and how to reproduce it

I get the following error when trying to download video (getBasicInfo works) using HTTP IP proxy:

MinigetError: Status code: 400

{
"name": "Error",
    "message": "Status code: 400",
    "stack": "Error: Status code: 400\n    at ClientRequest.<anonymous> (/app/node_modules/.pnpm/[email protected]/node_modules/miniget/dist/index.js:206:27)\n    at Object.onceWrapper (node:events:632:26)..."
}

the code

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; // without it TLS over http wont work (ERR_TLS_CERT_ALTNAME_INVALID error)

const videoUrl = "https://www.youtube.com/watch?v=5bId3N7QZec"; // 1 minute length

export const ytdlAgent = ytdl.createProxyAgent(
  { uri: 'http://login:[email protected]:11229' }, // the proxy i bought - provides ip port and login + pass
  cookies
);

const videoInfo = await ytdl.getBasicInfo(videoUrl, { agent: ytdlAgent }); // works

const videoStream = ytdl(link, {
        agent: ytdlAgent,
        ...options,
      });

const videoBuffer = await streamToBuffer(videoStream); // error

This error is produced both locally and on the cloud linux server.

Tested with multiple http ip proxy server providers.

Environment

  • @distube/ytdl-core version: 4.16.4
  • Node.js version: 18
  • Operating system: macOS Sonoma and Ubuntu 22.04 (data center)
@nezort11 nezort11 added the bug Something isn't working label Feb 27, 2025
@nezort11 nezort11 changed the title Error: Status code: 400 Error: Status code: 400 with HTTP IP proxy Feb 27, 2025
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

1 participant