kkdai / youtube

Download Youtube Video in Golang
MIT License
3.3k stars 430 forks source link

GetVideoContext: can't bypass age restriction: login required to confirm your age #336

Closed shoce closed 1 month ago

shoce commented 1 month ago

Using library

import ytdl "github.com/kkdai/youtube/v2"

few days ago ytdl.Client.GetVideoContext started to return error:

can't bypass age restriction: login required to confirm your age

for literally all videos.

65947689564 commented 1 month ago

I'm seeing the same problem.

ppalone commented 1 month ago

Related to https://github.com/yt-dlp/yt-dlp/issues/10128

TL;DR

Seems like YouTube has blacklisted your personal/virtual machine's IP to disallow use of downloaders. You'll have to change the virtual machine or wait for your IP to be changed/refreshed by your Internet service provider. The only solution the community has found is using cookies (obtained from an existing YouTube account) but it can lead to a temporary or a permanent ban.

Other solutions:

  1. Use VPN or proxy server
shoce commented 1 month ago

@ppalone thanks a lot for this!

shoce commented 1 month ago

i switched to another server with a different ip address but still getting the same error message, probably they banned the whole subnet :(

shoce commented 1 month ago

tried from a different server from a very different subnet, different datacenter, different country - still getting the same error message, but youtubedr still works from my laptop.

shoce commented 1 month ago

but youtubedr gives the same error message

can't bypass age restriction: login required to confirm your age

from the same server host

shoce commented 1 month ago

so i guess it is indeed the ban thing

cgzirim commented 3 weeks ago

Hello @shoce, Were you able to find a workaround to this problem? I'm facing the same issue and can't understand why it works on my computer but doesn't on my EC2 instance.

shoce commented 2 weeks ago

Hello @shoce, Were you able to find a workaround to this problem? I'm facing the same issue and can't understand why it works on my computer but doesn't on my EC2 instance.

Hey, I still haven't found a solution. The reason it works on your/my personal computer and doesn't work on EC2 instances or VMs in other hosting data centers is the IP address. Seems like google just banned most of IP addresses that belong to servers in data centers. I guess if you set up a VPN server on your EC2 instance and connect your computer to that VPN then you will see youtubedr does not work too. I still do not know what to do. Most probably going to host on my laptop for some time :)