jagrosh / MusicBot

🎶 A Discord music bot that's easy to set up and run yourself!
https://jmusicbot.com
Apache License 2.0
5.39k stars 2.58k forks source link

"Sign in to confirm you’re not a bot." error with YouTube videos #1588

Open MichailiK opened 5 months ago

MichailiK commented 5 months ago

Bug Description

Playing YouTube videos may fail with the error "Sign in to confirm you’re not a bot."

YouTube seems to have recently rolled out this measure. It's affecting not only third party players/clients, but also YouTube's official website & apps when logged out. Several communities have come across a few discoveries. Here's a summary of what I've seen:

  1. This is an IP block.
  2. Instead of just banning one IP, it looks YouTube is blocking whole ASNs/IP ranges. If you encounter this issue, it's likely a "neighboring" IP address was bombarding YouTube, causing them to block the ASN/IP range you're in.
  3. The cobalt.tools developers seem to have found a workaround using OAuth2. This currently has a PR in the lavaplayer youtube source manager, however it seems a bit risky.

We are in the process of implementing OAuth2 login for JMusicBot in #1670. Use this with an alternative/burner!!! Google account to play tracks again on blocked IPs.

Checklist

andy01745 commented 3 months ago

I am having the same problem. image

Johannes11833 commented 3 months ago

You could also route the requets through warp for now. Seems to work most of the time and does not require a paid vpn service.

services:
  jmusicbot:
    image: ghcr.io/yojoshb/jmusicbot-docker
    container_name: jmusicbot
    # environment:
    #   - BOT_VERSION=0.3.9 # You can omit the environment variable if you just want to run the latest version
    volumes:
      - ./config:/config
    restart: unless-stopped
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    restart: unless-stopped
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      # - WARP_LICENSE_KEY= # optional
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - ./data:/var/lib/cloudflare-warp
alanman87 commented 3 months ago

You could also route the requets through warp for now. Seems to work most of the time and does not require a paid vpn service.

services:
  jmusicbot:
    image: ghcr.io/yojoshb/jmusicbot-docker
    container_name: jmusicbot
    # environment:
    #   - BOT_VERSION=0.3.9 # You can omit the environment variable if you just want to run the latest version
    volumes:
      - ./config:/config
    restart: unless-stopped
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    restart: unless-stopped
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      # - WARP_LICENSE_KEY= # optional
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - ./data:/var/lib/cloudflare-warp

How would we do this for pterodactyl? I am running the bot via the pterodactyl egg.

judeabc20221 commented 3 months ago

You could also route the requets through warp for now. Seems to work most of the time and does not require a paid vpn service.

services:
  jmusicbot:
    image: ghcr.io/yojoshb/jmusicbot-docker
    container_name: jmusicbot
    # environment:
    #   - BOT_VERSION=0.3.9 # You can omit the environment variable if you just want to run the latest version
    volumes:
      - ./config:/config
    restart: unless-stopped
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    restart: unless-stopped
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      # - WARP_LICENSE_KEY= # optional
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - ./data:/var/lib/cloudflare-warp

Thanks, it's work!

Harshraj9812 commented 3 months ago

[!NOTE] Wrap Workaround is only working on jmusicbot:0.4.3 Release version only.

Tested & Working docker-compose.yaml Add your - BOT TOKEN

version: "3"
services:
  discord-bot:
    container_name: Hr-Music-bot-Discord
    restart: unless-stopped
    image: harshraj9812/hr-bot-jmusicbot:0.4.3
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    environment:
    # BOT TOKEN
      - TOKEN=
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    container_name: Wrap-Hr-Music-bot-Discord
    image: caomingjun/warp
    restart: unless-stopped
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      # - WARP_LICENSE_KEY= # optional
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - ./data:/var/lib/cloudflare-warp
driftywinds commented 3 months ago
version: "3"
services:
  discord-bot:
    container_name: Hr-Music-bot-Discord
    restart: unless-stopped
    image: harshraj9812/hr-bot-jmusicbot:0.4.3
    labels:
      - "com.centurylinklabs.watchtower.enable=false"
    environment:
    # BOT TOKEN
      - TOKEN=
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    container_name: Wrap-Hr-Music-bot-Discord
    image: caomingjun/warp
    restart: unless-stopped
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      # - WARP_LICENSE_KEY= # optional
    cap_add:
      - NET_ADMIN
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=0
      - net.ipv4.conf.all.src_valid_mark=1
    volumes:
      - ./data:/var/lib/cloudflare-warp

Can you build an arm64 image, or teach me how to do it for myself? Thank you so much! EDIT: - Nevermind, I ended up using this: - https://github.com/jagrosh/MusicBot/issues/1588#issuecomment-2295305229, which has arm64 support and it worked!

MichailiK commented 3 months ago

The upstream project has recently implemented OAuth2 authentication. I've just gotten around to write an implementation for it in #1670. I expect for this to be part of JMusicBot 0.4.5, to be released soon.

It should be trivial to set up, but I'll comment with quick instructions once 0.4.5 releases.

ghost commented 3 months ago

The west is collapsing

zaughon commented 2 months ago

The bot i'm running was recently hit by this issue. The thing is, the bot hadn't played any music for weeks, which made me wonder, is the bot constantly connecting to YT even when not playing music? If yes, what is the reasoning behind this? Or is it lavalink doing that for unknown reasons?

DaniDipp commented 2 months ago

@zaughon No, it's not connecting to YouTube when not searching for or playing videos. The reason is that YouTube is banning whole IP ranges of data centers. It's not personal.

Abujaman4685454 commented 2 months ago

Screenshot_20240911-155957

My inner tube was going fine until this came on telling me I should sign in to confirm that am not a bot I don't know and even though I restarted the app it's still happening 🥺😩

Abujaman4685454 commented 2 months ago

Screenshot_20240911-155957

My app was going well until this came and even though I try to restart the app it's still🥺🥺 please I need help

MichailiK commented 2 months ago

@Abujaman4685454

InnerTube

Note that you're posting this in the JMusicBot repository. You will need to ask help in the InnerTube repository, not here.

FOS92 commented 2 months ago

The IP Ban Is Real Had To Change My Hosting Location 3 times for the bot to work again

RayPlays commented 2 months ago

I used the jMusicBot for about half year, it worked really well and I love it, but after the last update it just don't want to play music from youtube at all because "Sign in to confirm you are not a bot" issue. Tried a lot of different discord music bots and found this:

https://github.com/LakhindarPal/discord-player-bot

Its a cool simple, easy to setup music bot, works both on windows and linux, and plays music from YouTube, Spotify, SoundCloud, Apple Music, Deezer, Tidal, and from more sources. Since it is using OAuth2 you guys should go take a look on it, maybe it can be used somehow to make jMusicBot better

tag27 commented 2 months ago

Since it is using OAuth2 you guys should go take a look on it, maybe it can be used somehow to make jMusicBot better

There's already a pull request from jMusicBot adding support for OAuth2, at least for YouTube (See #1670). You can test it if you want.

redswgd commented 1 month ago

i am facing the same issue.maybe open youtube in private window might solve the problem.

MichailiK commented 1 month ago

Thanks for all the thoughts & suggested workarounds everyone! We are now moving forward with implementing a way to login to an (alternative/burner!!!) Google account using OAuth2:

As plenty of workarounds have been suggested here & this issue's comments have somewhat derailed into chatter (which is probably cluttering the notifications of those subscribed to this issue), I'm going to lock it for now.

Once account login has been implemented & released, I'll comment again with quick instructions on authorizing JMusicBot with your Google account.

MichailiK commented 2 weeks ago

Unfortunately, YouTube has begun to crack down on the OAuth2 workaround, so it won't be viable. For people on VPS' (which are the most affected by this issue) might be able to use their (/64 or larger) IPv6 address space to workaround the IP bans. I'll see if I can get that implemented in JMusicBot, hopefully some time in the near future.