node-ytdl-core: Error: input stream: Status code: 429

Everything was working fine earlier today and yesterday until all of a sudden I started getting this error multiple time in my log file. I’ve never had a 429 response with this lib before. (Edit: This issue only happens on my VPS, it doesn’t happen on my local machine.)

Running ytdl-core@0.29.3

import ytdl from 'ytdl-core';
const ytdlOptions: {} = { filter: 'audioonly', quality: 'highestaudio' };
ytdl('https://youtube.com/watch?v=O6RyKbcpBfw', ytdlOptions);
Error: input stream: Status code: 429
    at ClientRequest.httpLib.get (/root/discord/music/poco/node_modules/miniget/lib/index.js:125:19)
    at Object.onceWrapper (events.js:286:20)
    at ClientRequest.emit (events.js:198:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:556:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
    at TLSSocket.socketOnData (_http_client.js:442:20)
    at TLSSocket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at TLSSocket.Readable.push (_stream_readable.js:224:10)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 18
  • Comments: 82 (18 by maintainers)

Most upvoted comments

Guys guys guys please fix this issue as fast as possible. I have worked so hard on my music app from months if this thing happens my all work will be wasted @fent Getting this today just requested few songs and error 429 coming using AWS EC2 Mumbai

@ShivamJoker Even if you have a front-end, you will not be able to make requests to YouTube due to CORS blocking them.

Same thing is happening to me!

@WaqasIbrahim thanks for the suggestion, however as that option is rather expensive, i don’t think that this is relevant to me either. 🤔 Is this issue a thing that this library/package should fix (seeing the cause of the issue and resent bump in 924’s) or rather something we (people who use ytdl) should fix (or rather work around) our self’s?

@waqaslbrahim how do you use proxy can you please tell me also

Dude relax itll be ok, I also have a site that Ive been working on for over a year that stopped working because of this. When this sort of stuff happens it is best you look for a short term solution by yourself while this gets fixed. What seemed to help me was deploying the part of my code that made a lot of youtube requests into different smaller deployments in what I think is the same ip, maybe thisll work for you.

Guys guys guys please fix this issue as fast as possible. I have worked so hard on my music app from months if this thing happens my all work will be wasted @fent Getting this today just requested few songs and error 429 coming using AWS EC2 Mumbai

I guess there is nothing programmatically to do. YouTube just ban IP’s that requests videos to fast.

See also ytdl-org/youtube-dl#21729.

Similar to what @Perflyst mentioned I believe this is only an issue when connecting to YouTube over IPv6.

If possible, you may try disabling it or force connecting over IPv4. Unfortunately I’m not sure how easy that is only using this library, but it may be possible to disable it depending on cloud provider or some other configuration.

Google/YouTube has blocked my whole /64 IPv6 subnet due to one IPv6 address which I deployed recently to my invidious instance. The IPv4 address worked since a few months and is still working. Only IPv6 is blocked.

What provider do you use? I use Hetzner. Maybe it is something provider specific?

Does anyone know if switching over to a NorthAmerican VPS would help with this issue? I currently use a German VPS.

i’m using a north american vps and i’m facing the same issue

@ShivamJoker keep in mind that not all “apps” have a front-end in the browser or aren’t able to execute code on the client side.

Same here, we’re fucked up.