distubejs / ytdl-core

YouTube video downloader in javascript.
MIT License
187 stars 40 forks source link

Access to rr4---sn-qxaeenlz.googlevideo.com was denied (Status code: 403) #31

Closed msalik42 closed 3 weeks ago

msalik42 commented 1 month ago

Ran the following code and it returns the video URLs, But when I try to access the files, it says access denied const ytdl = require("@distube/ytdl-core");

ytdl.getBasicInfo("https://www.youtube.com/watch?v=eFe8bJ9e_FA").then((info) => { console.log(info); });

Pesepvtltd commented 1 month ago

have you got solution?

skick1234 commented 1 month ago

Due to recent youtube changes, you have to update to the latest version and download the stream from the same ip (and maybe the cookies). So if you want to download it from another client, you have to download it to your server and use other methods to download it from your server.

Lampropoulosss commented 1 month ago

The issue is that I use the library on the server and I stream the video to my client myself. So, no other IP is used or anything. And it still, randomly, throws the error.

skick1234 commented 1 month ago

It seems youtube blocked download some itag, try changing the format, quality or filter options

mtripg6666tdr commented 1 month ago

FYI this issue may be related to this pr

pauliusdotpro commented 1 month ago

I've also started getting issues

Raul824 commented 1 month ago

Well after fiddling with all permutations and combinations my assumption is there is some kind of protection on official channels or some strings.

So If i tried to getinfo of official music video the stream gives 403 error but if I do a getinfo of same song uploaded by someone else it works.

example. This doesn't work https://www.youtube.com/watch?v=eFjjO_lhf9c

This works https://www.youtube.com/watch?v=1i0i5lG6Ojc

@msalik42 Try same thing on reaction video of the original video.

vasanth-raja commented 1 month ago

403 fixed or any solutions yet?

skick1234 commented 4 weeks ago

I disabled cache on 4.13.7, 403 is gone on my side but I don't know if it works on every video. Please try it and give feedback.

ichsanulaulia commented 4 weeks ago

I disabled cache on 4.13.7, 403 is gone on my side but I don't know if it works on every video. Please try it and give feedback.

image all format quality etc , 403 at all but this happend for some videos not all videos

skick1234 commented 4 weeks ago

image

all format quality etc , 403 at all

but this happend for some videos not all videos

Can you give me video url and your ip location as well?

ichsanulaulia commented 4 weeks ago

Can you give me video url and your ip location as well?

https://youtu.be/ozckx6_Z2a4 ip loc : Germany

vasanth-raja commented 4 weeks ago

i switched to another package thats working at the moment, but docs are not easy to pick up https://github.com/LuanRT/YouTube.js/blob/main/examples/download/index.ts

skick1234 commented 4 weeks ago

Can you give me video url and your ip location as well?

https://youtu.be/ozckx6_Z2a4 ip loc : Germany

Weird, I don't have any problem with it, can you test with browser headers like user-agent, origin,... and cookies. I don't have 403 problem with your video

fsholehan commented 4 weeks ago

Now, the local environment is also getting a 403 error.

Lampropoulosss commented 3 weeks ago

i switched to another package thats working at the moment, but docs are not easy to pick up https://github.com/LuanRT/YouTube.js/blob/main/examples/download/index.ts

Doens't work. Tried it with a few videos, for most of them it logs "server responded with not a 2.x.x status code

alanor87 commented 3 weeks ago

The same - 403 on some videos - others are being downloaded normally.

https://www.youtube.com/watch?v=6OZQ9Y2c1kY - works

https://www.youtube.com/watch?v=FavdK4bv56Q - does not work

Lampropoulosss commented 3 weeks ago

Does this issue appear to other libraries / tools too? Such as yt-dlp, youtube-dl etc?

nukeop commented 3 weeks ago

After I updated to the newest release, these problems are completely gone.

fsholehan commented 3 weeks ago

After I updated to the newest release, these problems are completely gone.

Yes, but with the same video, sometimes it returns a 403 error, and sometimes it works.

yyildiz commented 3 weeks ago

Are you on the latest @fsholehan?

nukeop commented 3 weeks ago

Suddenly 403s are back, with almost every single stream.

fsholehan commented 3 weeks ago

Are you on the latest @fsholehan?

Yes, I'm on the latest version

skick1234 commented 3 weeks ago

It looks like YouTube is conducting A/B testing to prevent bots. I’ll look into their anti-bot token and update the package after my working hours.

red1ul commented 3 weeks ago

It looks like YouTube is conducting A/B testing to prevent bots. I’ll look into their anti-bot token and update the package after my working hours.

Please refer to the following URL: https://x.com/justusecobalt/status/1799043789967036620

Marbanz commented 3 weeks ago

I did some testing and found out that using cookies of a yt premium account doesn't give errors, while without cookies or with the cookies of a non premium account it gives the 403 error

DevBelkin commented 3 weeks ago

I did some testing and found out that using cookies of a yt premium account doesn't give errors, while without cookies or with the cookies of a non premium account it gives the 403 error

I also tried with the premium account and it works without any error.

Brainicism commented 3 weeks ago

https://github.com/yt-dlp/yt-dlp/pull/10457 Not sure if you've seen this already, yt-dlp mitigated this by swapping to a non-web client.

Also: https://github.com/yt-dlp/yt-dlp/pull/10648