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

Sign in to confirm you're not a bot #1049

Open
1 of 3 tasks
DrNefarius opened this issue Jul 18, 2024 · 31 comments
Open
1 of 3 tasks

Sign in to confirm you're not a bot #1049

DrNefarius opened this issue Jul 18, 2024 · 31 comments
Labels

Comments

@DrNefarius
Copy link

What's happening?
With the newest version, I get the message "Sign in to confirm you're not a bot" whenever I try to play a song.
Example command:
/play query: https://www.youtube.com/watch?v=lgh68Swuak0

Logs

  muse Error: Sign in to confirm you’re not a bot
  muse     at privateVideoError (/usr/app/node_modules/@distube/ytdl-core/lib/info.js:91:12)
  muse     at exports.getBasicInfo (/usr/app/node_modules/@distube/ytdl-core/lib/info.js:54:22)
  muse     at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +552ms

Screenshots
image

Runtime
I'm running Muse:

  • Directly from the cloned repository
  • Inside a Docker container
  • Something else (please elaborate)

Versions

  • Muse: 2.9.0
  • Docker (if applicable): 26.1.3, build b72abbb
  • OS: Ubuntu 20.04.6 LTS
@Stealthii
Copy link

Stealthii commented Jul 18, 2024

This is a wider issue affecting many other bots using Youtube's API.

It seems like the cobalt client implemented OAuth tokens to circumvent this:
imputnet/cobalt#558

Our issue is that ytsr (now no longer supported) @distube/ytsr (used as of #1024) does not use any OAuth or API tokens for the search requests.

A couple ways of tackling this:

  • switch out the use of ytsr (and got possibly) for @googleapis/youtube, utilizing the auth we already have used in other API requests
    • Bigger rewrite, but unifies Youtube API access under one library
    • Longer term support from Google via official library and sole v3 usage
  • PR a feature to restore optional apiKey in distube's ytsr fork
    • Quicker fix
    • Need to verify keys with ACL for Youtube API v3 still work for v1
    • v1 deprecated and may disappear in future

@arty01238
Copy link

I'm also experiencing this issue!

@kwatman
Copy link

kwatman commented Jul 25, 2024

I also have this problem.

@NYCITGuy
Copy link

I also have this problem! Same configuration

@MiguelCollado
Copy link

Hi! I'm currently trying to figure it out, based on the comment @Stealthii made. Apparently, there is no issue with @distube/ytsr, (from what I have just tested, the search part is just OK). I think the problem revolves around ytdl instead, when it tries to get the audio stream.

That ytdl call to fetch for the info has no apiKey whatsoever, so maybe there is an alternative? I dunno, I'll keep trying to solve this issue

@Fheuef
Copy link

Fheuef commented Jul 29, 2024

I'm also experiencing this, even when trying to play songs from Spotify weirdly enough.

In case it's relevant, just before having this error, the bot was acting weird when trying to play a song.

  • First it replied "ope: No playing song found", and joined vc
  • Then it claimed the song was added to the queue, but nothing was playing and the queue was empty
  • Now it's stuck replying "Sign in..." to every request, for both Youtube and Spotify

@MuazAlhaidar
Copy link

MuazAlhaidar commented Aug 4, 2024

Currently experiencing this issue when hosting the Jmusicbot app on PebbleHost
image

From the Console
[[INFO]] [JMusicBot]: Loaded config from /config.txt
[[INFO]] [Settings]: serversettings.json will be created in /serversettings.json
[[INFO]] [JDA]: Login Successful!
[[INFO]] [WebSocketClient]: Connected to WebSocket
[[INFO]] [JMusicBot]: JMusicBot
[23:27:44] [[INFO]] [JDA]: Finished Loading!
[[ERROR]] [SignatureCipherManager]: Problematic YouTube player script /s/player//player_ias.vflset/en_GB/base.js detected (issue detected with script: no n function match). Dumped to /tmp/lavaplayer-yt-player-script.js

The command I ran: ?p https://youtu.be/a_aIaO88rzY?feature=shared

@Fheuef
Copy link

Fheuef commented Aug 8, 2024

Still unable to play anything, though now it does log WARNING: @distube/ytdl-core is out of date! Update with "npm install @distube/ytdl-core@latest" when requesting a song.

This is using the latest version with Docker Compose so I'm unable to run this before the container starts, will try tomorrow to install it manually.

@GrantBirki
Copy link

Getting the exact same issue as well

@Fheuef
Copy link

Fheuef commented Aug 15, 2024

To add more info here (gathered mostly from the links above), this appears to be an IP block from youtube. Apparently it can even happen because a neighboring IP spammed the youtube API too much.

I can confirm that, while my VPS has been unable to play anything for more than a month, I was able to play songs from both youtube and spotify when running the bot on my own PC.

Some users on other projects were able to access the API with rotating IPv6, cookies from an account that is currently logged in, using a proxy, or with OAuth 2.

I haven't found any workaround that we could use so far, besides running the bot on a entirely different IP.

@jedichrome
Copy link

Just updated to the latest build and getting this as well.

@jedichrome
Copy link

jedichrome commented Aug 19, 2024

I got around this by making Muse dependent on Warp.
Found the workaround here: jagrosh/MusicBot#1588

    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

@karmirith
Copy link

I got around this by making Muse dependent on Warp. Found the workaround here: jagrosh/MusicBot#1588

    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 do I make this work within my Docker application?

@jedichrome
Copy link

jedichrome commented Aug 21, 2024

How do I make this work within my Docker application?

Just append the above to your docker-compose.yml for Muse and then run docker-compose up -d

In the end it should look similar to this:

version: '3.4'

services:
  muse:
    image: ghcr.io/museofficial/muse:latest
    restart: always
    volumes:
      - ./muse:/data
    environment:
      - DISCORD_TOKEN=
      - YOUTUBE_API_KEY=
      - SPOTIFY_CLIENT_ID=
      - SPOTIFY_CLIENT_SECRET=
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    container_name: warp
    restart: always
    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

@EugeneLeclerc
Copy link
Contributor

I got around this by making Muse dependent on Warp. Found the workaround here: jagrosh/MusicBot#1588

Thanks for the fix! Should we merge this into Muse? The IP-banning from Youtube looks like it will stay, so we need a long term solution.

@arty01238
Copy link

How do I make this work within my Docker application?

Just append the about to your docker-compose.yml for Muse and then run docker-compose up -d

In the end it should look similar to this:

version: '3.4'

services:
  muse:
    image: ghcr.io/museofficial/muse:latest
    restart: always
    volumes:
      - ./muse:/data
    environment:
      - DISCORD_TOKEN=
      - YOUTUBE_API_KEY=
      - SPOTIFY_CLIENT_ID=
      - SPOTIFY_CLIENT_SECRET=
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    container_name: warp
    restart: always
    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

I can vouch that this works for me! Though I assume they will find a way to implement it into the project overall?

@Hazzajenko
Copy link
Contributor

Is this issue still present in muse v2.9.3 or v2.9.4?

The recent update to @distube/ytdl-core in v2.9.3 has addressed various problems.

@EugeneLeclerc
Copy link
Contributor

Is this issue still present in muse v2.9.3 or v2.9.4?

The recent update to @distube/ytdl-core in v2.9.3 has addressed various problems.

Yeah, this is not a @distube/ytdl-core issue. Youtube is blocking IPs, there is nothing that can be done on yt-dlp's end, you just have to get an unbanned IP or route your requests through something else (like Warp).

@P529
Copy link

P529 commented Sep 2, 2024

How do I make this work within my Docker application?

Just append the about to your docker-compose.yml for Muse and then run docker-compose up -d
In the end it should look similar to this:

version: '3.4'

services:
  muse:
    image: ghcr.io/museofficial/muse:latest
    restart: always
    volumes:
      - ./muse:/data
    environment:
      - DISCORD_TOKEN=
      - YOUTUBE_API_KEY=
      - SPOTIFY_CLIENT_ID=
      - SPOTIFY_CLIENT_SECRET=
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    container_name: warp
    restart: always
    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

I can vouch that this works for me! Though I assume they will find a way to implement it into the project overall?

I've tried to set up muse to run with this but the moment I start it with Warp I just get timed out when trying to queue anything. Without warp the bot doesnt time out but I also have the problem of youtube not allowing my connection.

@EugeneLeclerc
Copy link
Contributor

I've tried to set up muse to run with this but the moment I start it with Warp I just get timed out when trying to queue anything. Without warp the bot doesnt time out but I also have the problem of youtube not allowing my connection.

Same for me, Warp worked perfectly for a week, and now I have timeout issues.

@GeorgeGo
Copy link

I've tried to set up muse to run with this but the moment I start it with Warp I just get timed out when trying to queue anything. Without warp the bot doesnt time out but I also have the problem of youtube not allowing my connection.

Same for me, Warp worked perfectly for a week, and now I have timeout issues.

Would moving to using the youtube api without warp work as a solution? I'm running ghcr muse latest as a docker container on digital ocean and it's either "Sign in to confirm you're not a bot" without warp or timeouts with warp.

@jogerj
Copy link

jogerj commented Oct 14, 2024

So far having same issues of "Sign in to confirm you're not a bot" or timeouts with warp. My instance is hosted on Oracle Cloud.

yt-dlp has an option to pass cookies.txt, so you can create some dummy account and pass its cookies to be "signed in". For us this means the bot needs to be configured to accept and pass the cookies to yt-dlp if configured.

@tyteen4a03
Copy link

Are there any updates to this?

@HerIsDia
Copy link

HerIsDia commented Nov 5, 2024

Bug still on in v2.10.0!

@arty01238
Copy link

arty01238 commented Nov 6, 2024

It's not really a bug anymore, if you are experiencing this issue, you either need to change the External IP address or use the warp thing mentioned above and add it to the docker compose file. It's because Google hit you with IP limit on API

@tyteen4a03
Copy link

It's not really a bug anymore, if you are experiencing this issue, you either need to change the External IP address or use the warp thing mentioned above and add it to the docker compose file. It's because Google hit you with IP limit on API

Warp didn't work for me, the application just hung instead.

Would appreciate official guidance on this!

@Happyllama25
Copy link

@tyteen4a03
I just added the Warp segment on my compose file ~30 mins ago and its working perfectly

@tyteen4a03
Copy link

@tyteen4a03
I just added the Warp segment on my compose file ~30 mins ago and its working perfectly

Which provider are you on? I'm on Hetzner.

@Happyllama25
Copy link

@tyteen4a03
I just added the Warp segment on my compose file ~30 mins ago and its working perfectly

Which provider are you on? I'm on Hetzner.

Oracle Cloud, I moved my Muse instance to a different node, got the same error, added the Warp dependency and it started working.

If the data center IP has been blacklisted by youtube then there is not that much one can do to unblock.
One could potentially route the traffic via VPN to a household IP.

@Resonant4949
Copy link

Oracle Cloud, I moved my Muse instance to a different node, got the same error, added the Warp dependency and it started working.

If the data center IP has been blacklisted by youtube then there is not that much one can do to unblock. One could potentially route the traffic via VPN to a household IP.

I also run my bot on Oracle Cloud. Unfortunately, Warp does not solve this problem for me permanently. Everything works great for a few hours, but then I get the error message “Sign in to confirm you're not a bot” despite Warp.

@RooRay
Copy link

RooRay commented Dec 15, 2024

For anyone seeing this in the future, looking to implement the WARP solution, breaking changes to the way the container works were introduced by a containerd update in late November, (see this) requiring some light changes. Updated config is this:

services:
  muse:
    image: ghcr.io/museofficial/muse:latest
    restart: always
    volumes:
      - ./muse:/data
    environment:
      - DISCORD_TOKEN=YOURS HERE
      - YOUTUBE_API_KEY=YOURS HERE
      # Below are all optional
      # - SPOTIFY_CLIENT_ID=
      # - SPOTIFY_CLIENT_SECRET=
      # - CACHE_LIMIT=10GB
      # - ENABLE_SPONSORBLOCK=true
      # - SPONSORBLOCK_TIMEOUT=2
      # - BOT_STATUS=online
      # - BOT_ACTIVITY_TYPE=LISTENING
      # - BOT_ACTIVITY_URL=   # Not used for non-streaming activity types
      # - BOT_ACTIVITY=your shite music
    network_mode: "service:warp"
    depends_on:
      - warp
  warp:
    image: caomingjun/warp
    container_name: warp
    restart: always
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - '1080:1080'
    environment:
      - WARP_SLEEP=2
      - WARP_LICENSE_KEY=UBW6t134-3A6b24Km-nJ286iN9
    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

Tip

Using a WARP+ key is HIGHLY recommended since you get extra fast bandwidth and better servers. If you need a WARP+ key with a bunch of bandwidth, use one from here.

Warning

If you previously restricted your YouTube Data API key by IP address, this will no longer work. Either remove the restriction or add Cloudflare's IP ranges which are available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests