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

Update distube dependencies for improved YouTube support #1180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Codixer
Copy link
Contributor

@Codixer Codixer commented Dec 29, 2024

Closes #1173
Closes #1171
Closes #1166
Closes #1165
Closes #1163

  • Updated Distube

@codetheweb
Copy link
Collaborator

📦 🤖 A new release has been made for this pull request.

To play around with this PR, pull ghcr.io/museofficial/muse:pr-1180.

Images are available for x86_64 and ARM64.

Latest commit: 98fdd3f

@Codixer
Copy link
Contributor Author

Codixer commented Dec 29, 2024

@timurko-uwu @SparksSkywere @QuintenQVD0 @ascensionfm @AptGetGnome @kirankunigiri @cwerdna19 @Wancerz @WojenHere @DaanSelen @ThomasHineXYZ @aaddyy227 @arty01238 @Zereah

Hello there! All of you should be having the same issue currently with Muse being unable to play music at this moment, currently... this seems like an issue with several things. Either ffmpeg being annoying, ytdl being annoying or some other issues that I currently can't find. However, in this case. It seems like YTDL seems to be the most damning issue at this moment. As it seems like we are not the only one with the issue, and timelines more or less match up with distubejs/ytdl-core#157 distubejs/ytdl-core#156 and distubejs/ytdl-core#153

If you are able to, please do the following. Add DEBUG=* to your env file, and then make a comment on this PR with your FULL log. Make sure to backtick your code

Caution

MAKE SURE YOUR TOKEN/API KEY IS NOT VISIBLE IN THE LOG

Additionally, if you want to take a gander, try upgrading/downgrading muse, ytdl-core and/or ffmpeg to see if this resolves your issue. As several issues are going on at a time, and I can't test all of them.

@QuintenQVD0
Copy link

QuintenQVD0 commented Dec 29, 2024

@timurko-uwu @SparksSkywere @QuintenQVD0 @ascensionfm @AptGetGnome @kirankunigiri @cwerdna19 @Wancerz @WojenHere @DaanSelen @ThomasHineXYZ @aaddyy227 @arty01238 @Zereah

Hello there! All of you should be having the same issue currently with Muse being unable to play music at this moment, currently... this seems like an issue with several things. Either ffmpeg being annoying, ytdl being annoying or some other issues that I currently can't find. However, in this case. It seems like YTDL seems to be the most damning issue at this moment. As it seems like we are not the only one with the issue, and timelines more or less match up with distubejs/ytdl-core#157 distubejs/ytdl-core#156 and distubejs/ytdl-core#153

If you are able to, please do the following. Add DEBUG=* to your env file, and then make a comment on this PR with your FULL log. Make sure to backtick your code

[!CAUTION]
MAKE SURE YOUR TOKEN/API KEY IS NOT VISIBLE IN THE LOG

Additionally, if you want to take a gander, try upgrading/downgrading muse, ytdl-core and/or ffmpeg to see if this resolves your issue. As several issues are going on at a time, and I can't test all of them.

I have tried to update every npm module as far as I can without code errors. It does not resolve it.

@DaanSelen
Copy link

I weirdly do not have the issue... what should be happening?

@Codixer
Copy link
Contributor Author

Codixer commented Dec 29, 2024

I weirdly do not have the issue... what should be happening?

What is your current env? Muse version, FFMPEG, distube, etc. Where are you hosting (and so on and so forth).

@DaanSelen
Copy link

Running inside Kubernetes 1.31.3

    Image:          ghcr.io/museofficial/muse:latest
    Image ID:       ghcr.io/museofficial/muse@sha256:1d4d3c0a30b1bc22fbeedbbdee94ee350d9547c886f7b581bcdf20d00b774213

https://github.com/museofficial/muse/pkgs/container/muse

I don't think anything else is installed by me other than the information for running.
If you need anything specific let me know!

@cwerdna19
Copy link

cwerdna19 commented Dec 29, 2024

I ended up writing my own music bot because of this not working. While doing that I discovered that the latest release of @distube/ytdl-core, 4.15.8, is not working apparently universally. I downgraded to 4.15.4, and my bot worked.

I kind of gave up on muse, and started to find justifications for my own (scuffed) bot, like there being muse dependencies that have not been updated for over 2 years, and have severe vulnerabilities. Like a VM2 dependency. Not really sure if there is a real concern for these dependency vulnerabilities.

Coming back to muse, it works fine now with @distube/[email protected]. Basically, if I had probably just investigated a little bit I would have found that I needed to update ytdl (and downgrade? because the current muse package.json version is 4.14.4), but there were no errors or logs, just a silent failure.

I had also apparently had issues with using different versions of node. ope: Error: Cannot find module '/home/cratos/muse/node_modules/@discordjs/opus/prebuild/node-v131-napi-v3-linux-x64-glibc-2.35/opus.node' I believe I changed versions because I was having issues, and probably ended up creating more problems.

Anyway, to verify, I stashed my changes and checked out muse v2.10.0 again to avoid any stupid package version changes I did. rm -rf node_modules/, then did npm i. This just grabbed @distube/[email protected] anyway now

Just soapboxing sorry. From my experience, it appears to be working now. I didn't record which version of @distube/ytdl-core was being grabbed before. It was probably a ytdl-core issue, but I had convoluted the issue by changing dependency versions, and changing node versions.
Edit: I'm running muse on bare metal, without docker.

Edit2:
Env:

Packages:

[email protected] /home/cwerdna19/muse
├── @discordjs/[email protected]
├── @discordjs/[email protected]
├── @discordjs/[email protected]
├── @discordjs/[email protected]
├── @distube/[email protected]
├── @distube/[email protected]
├── @prisma/[email protected]
├── @release-it/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

ffmpeg:

ffmpeg -v
ffmpeg version 4.4.2

npm

npm -v
10.9.0

node

node -v
v22.12.0

OS: Ubuntu 22.04.5 LTS

Sorry, should've included my env earlier. Hope this helps.

Edit3:

Just tested 4.15.8 for fun. It works.

npm view @distube/ytdl-core version
4.15.8

I learned a lot about using node from all this, but I suppose it's possible I'm doing something wrong and using a version of ytdl installed somewhere else.
I'm using NVM to get the latest stable release of node. To kill my installed packages, I'm doing rm -rf node_modules/. I updated package.json to have "@distube/ytdl-core": "^4.15.8",, then I ran npm i in the same dir as my muse stuff (same dir as package.json).

I also confirmed that 4.15.8 does not work with the other music bot I made. The same behavior occurs; the bot joins then immediately leaves.
I don't understand why 4.15.8 would work with muse now, but not with my bot, which makes me think that I must be doing something wrong.
Development of my other bot is occurring on the same Ubuntu machine that I'm running muse on. In different folders, of course. Muse is in ~/muse, my bot is in ~/otherbotname.

I'll stop adding edits I think I confused things enough. Again, hope this helps.

@Codixer
Copy link
Contributor Author

Codixer commented Dec 29, 2024

@cwerdna19 thanks for your (VERY) detailed explaination. I'll see if I can downgrade to the version you are using. And lock it there for the time being.

I looked at the code. And yes, there is a TON of outdated code and packages in there. So I'm not sure how stable it's gonna be...

@SparksSkywere
Copy link

I have read what is here, I also run a Teamspeak server with my own music bot there, recently I had to update the YouTube-DL.exe file I had there and it worked fine, so it sounds to me like a YouTube situation (adblockers maybe).

I am running this bare metal on Windows Sever along with my Teamspeak bot in windows services. Following cwerden's comments I have tried running "4.15.4" of ytdl-core but sadly no audio, this debug however shows the video did somewhat parse but I did not hear anything in the VC with the bot.

WARNING: @distube/ytdl-core is out of date! Update with "npm install @distube/ytdl-core@latest".
  muse Using format {
  mimeType: 'audio/webm; codecs="opus"',
  qualityLabel: null,
  bitrate: 132495,
  audioBitrate: 160,
  itag: 251,
  url: 'https://rr5---sn-8pgbpohxqp5-aigy.googlevideo.com/videoplayback?expire=1735538407&ei=h-JxZ8jxG6XCmLAPo63lmQM&ip=86.10.160.86&id=o-ABwEWv0Yjd1pbJgcEqNrlkONhGJie50_k4_RJ-9eQf3H&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1735516807%2C&mh=lf&mm=31%2C26&mn=sn-8pgbpohxqp5-aigy%2Csn-5hneknee&ms=au%2Conr&mv=m&mvi=5&pcm2cms=yes&pl=24&rms=au%2Cau&gcr=gb&initcwndbps=4337500&bui=AfMhrI-bqvubaTcnOdvy9Mi1TptJKc3EK4O51_UXZtoYZtD3XHtUOtlCRS2zNv1cYlskGFoKaUNq8WqE&spc=x-caUGtgd5Uw1fHZrbQEkRs4kJCgoHeFmDNzW9yKpZ0MATmfmkiBXS1hdEU5&vprv=1&svpuc=1&mime=audio%2Fwebm&rqh=1&gir=yes&clen=9367497&dur=587.181&lmt=1714750594128606&mt=1735516391&fvip=1&keepalive=yes&fexp=51326932%2C51335594%2C51371294&c=IOS&txp=2318224&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cgcr%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAJEyY7ThJK7AOSqoVw_fkmi1ucZtmV5UDnIPU9tfRo6rAiBMB7hHpcyWejpx-VrNZBiUdNZPitWo0POSrkVbfPtL-Q%3D%3D&lsparams=met%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Crms%2Cinitcwndbps&lsig=AGluJ3MwRQIgf3Ag8pLXiranj1KjLW5UZTjjqQ8stCdbyr4SJA1DY2ICIQC1cFBRLW267GfXFwO1EmXwg2z7I04iVneusSnwSaCS5Q%3D%3D',
  initRange: { start: '0', end: '258' },
  indexRange: { start: '259', end: '1258' },
  lastModified: '1714750594128606',
  contentLength: '9367497',
  quality: 'tiny',
  projectionType: 'RECTANGULAR',
  averageBitrate: 127626,
  audioQuality: 'AUDIO_QUALITY_MEDIUM',
  approxDurationMs: '587181',
  audioSampleRate: '48000',
  audioChannels: 2,
  loudnessDb: 5.37,
  hasVideo: false,
  hasAudio: true,
  container: 'webm',
  codecs: 'opus',
  videoCodec: null,
  audioCodec: 'opus',
  isLive: false,
  isHLS: false,
  isDashMPD: false
} +1s
+1s
  muse Caching video +5ms
  muse [WS => Shard 0] First heartbeat sent, starting to beat every 41250ms +9s
  muse [WS => Shard 0] Heartbeat acknowledged, latency of 114ms. +114ms
  muse [WS => Shard 0] Heartbeat acknowledged, latency of 129ms. +41s
  muse [WS => Shard 0] Heartbeat acknowledged, latency of 123ms. +41s
  prisma:client  Prisma Client call: +2m
  prisma:client  prisma.setting.findUnique({
  where: {
    guildId: '504084859757658123'
  }
}) +1ms
  prisma:client  Generated request: +1ms
  prisma:client  query {
  findUniqueSetting(where: {
    guildId: "504084859757658123"
  }) {
    guildId
    playlistLimit
    secondsToWaitAfterQueueEmpties
    leaveIfNoListeners
    queueAddResponseEphemeral
    autoAnnounceNextSong
    defaultVolume
    defaultQueuePageSize
    turnDownVolumeWhenPeopleSpeak
    turnDownVolumeWhenPeopleSpeakTarget
    createdAt
    updatedAt
  }
}
 +1ms

I also did a debug with the current environment which is below with the latest youtube core "4.15.8" and all other modules up to date:

`starting` discord music bot "Sir Groovington Sixth"

> [email protected] start
> npm run env:set-database-url -- tsx src/scripts/migrate-and-start.ts


> [email protected] env:set-database-url
> tsx src/scripts/run-with-database-url.ts tsx src/scripts/migrate-and-start.ts

(node:19096) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///C%3A/Users/Administrator/Documents/Servers/Discord/Bots/muse/node_modules/tsx/dist/loader.js", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29280) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("file%3A///C%3A/Users/Administrator/Documents/Servers/Discord/Bots/muse/node_modules/tsx/dist/loader.js", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
  prisma:tryLoadEnv  Environment variables loaded from C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\.env +0ms
  prisma:client  checkPlatformCaching:postinstall true +0ms
  prisma:client  checkPlatformCaching:ciName undefined +1ms
  prisma:tryLoadEnv  Environment variables loaded from C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\.env +590ms
  prisma:client  dirname C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\.prisma\client +0ms
  prisma:client  relativePath ../../.. +1ms
  prisma:client  cwd C:\Users\Administrator\Documents\Servers\Discord\Bots\muse +0ms
  prisma:client  protocol graphql +0ms
  prisma:client  clientVersion 4.16.0 +1ms
  prisma:client  clientEngineType library +0ms
  prisma:client:libraryEngine  internalSetup +0ms
  prisma:client  checkPlatformCaching:postinstall true +651ms
  prisma:client  checkPlatformCaching:ciName undefined +1ms
  prisma:tryLoadEnv  Environment variables loaded from C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\.env +654ms
  prisma:client  dirname C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\.prisma\client +652ms
  prisma:client  relativePath ../../.. +0ms
  prisma:client  cwd C:\Users\Administrator\Documents\Servers\Discord\Bots\muse +0ms
  prisma:client  protocol graphql +1ms
  prisma:client  clientVersion 4.16.0 +1ms
  prisma:client  clientEngineType library +0ms
  prisma:client:libraryEngine  internalSetup +654ms
========================================
========================================
================= muse =================
========================================
=========== Made with 🎶 by ============
==== https://github.com/codetheweb =====
========================================
========================================

Running version 2.10.0 built on unknown date (commit unknown)

🔧 Need help? https://github.com/codetheweb/muse/discussions/new
🐛 Bug? https://github.com/codetheweb/muse/issues/new
✨ New feature? https://github.com/codetheweb/muse/issues/new
☕ Discussion? https://github.com/codetheweb/muse/discussions/new
💰 Help me? https://www.paypal.me/codetheweb https://github.com/sponsors/codetheweb


- Applying database migrations...  prisma:client:engines:resolveEnginePath  enginePath C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\.prisma\client\query_engine-windows.dll.node +0ms
  prisma:client:engines:resolveEnginePath  enginePath C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\.prisma\client\query_engine-windows.dll.node +1ms
  prisma:client:libraryEngine  library starting +33ms
  prisma:client:libraryEngine  library started +7ms
  prisma:client  prisma.$queryRaw(SELECT COUNT(id) FROM _prisma_migrations, []) +0ms
  prisma:client  Prisma Client call: +56ms
  prisma:client  prisma.$queryRaw({
  query: 'SELECT COUNT(id) FROM _prisma_migrations',
  parameters: {
    values: '[]',
    __prismaRawParameters__: true
  }
}) +1ms
  prisma:client  Generated request: +1ms
  prisma:client  mutation {
  queryRaw(
    query: "SELECT COUNT(id) FROM _prisma_migrations"
    parameters: "[]"
  )
}
 +1ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +19ms
√ Database migrations applied.
  prisma:client:libraryEngine  library starting +828ms
  prisma:client:libraryEngine  library started +1ms
  prisma:client  Prisma Client call: +836ms
  prisma:client  prisma.fileCache.findMany({
  where: undefined,
  orderBy: {
    createdAt: 'asc'
  },
  take: 50
}) +0ms
  prisma:client  Generated request: +1ms
  prisma:client  query {
  findManyFileCache(
    orderBy: [
      {
        createdAt: asc
      }
    ]
    take: 50
  ) {
    hash
    bytes
    accessedAt
    createdAt
    updatedAt
  }
}
 +0ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +8ms
  muse Evicting oldest files... +0ms
  prisma:client  Prisma Client call: +4ms
  prisma:client  prisma.fileCache.aggregate({
  select: {
    _sum: {
      select: {
        bytes: true
      }
    }
  }
}) +1ms
  prisma:client  Generated request: +1ms
  prisma:client  query {
  aggregateFileCache {
    _sum {
      bytes
    }
  }
}
 +5ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +11ms
  superagent POST https://accounts.spotify.com/api/token +0ms
  superagent POST https://accounts.spotify.com/api/token +5ms
- 📡 connecting to Discord...  muse Provided token: *.************************************** +37ms
  muse Preparing to connect to the gateway... +1ms
  muse No files needed to be evicted. Total size of the cache is currently 0 bytes, and the cache limit is 4000000000 bytes. +10ms
  superagent POST https://accounts.spotify.com/api/token -> 200 +105ms
  superagent POST https://accounts.spotify.com/api/token -> 200 +4ms
| 📡 connecting to Discord...  muse [WS => Manager] Fetched Gateway Information
  muse     URL: wss://gateway.discord.gg
  muse     Recommended Shards: 1 +263ms
  muse [WS => Manager] Session Limit Information
  muse     Total: 1000
  muse     Remaining: 999 +0ms
  muse [WS => Shard 0] Connecting to wss://gateway.discord.gg?v=10&encoding=json +3ms
  muse [WS => Shard 0] Waiting for event hello for 60000ms +3ms
/ 📡 connecting to Discord...  muse [WS => Shard 0] Preparing first heartbeat of the connection with a jitter of 0.1678403847209302; waiting 6923ms +163ms  muse [WS => Shard 0] Waiting for identify throttle +2ms
  muse [WS => Shard 0] Identifying
  muse  shard id: 0
  muse  shard count: 1
  muse  intents: 1153
  muse  compression: none +1ms
  muse [WS => Shard 0] Waiting for event ready for 15000ms +2ms
- 📡 connecting to Discord...  muse [WS => Shard 0] Shard received all its guilds. Marking as fully ready. +196ms
  muse --------------------------------------------------
  muse Core Dependencies
  muse - @discordjs/voice: 0.17.0
  muse - prism-media: 1.3.5
  muse
  muse Opus Libraries
  muse - @discordjs/opus: 0.8.0
  muse - opusscript: not found
  muse
  muse Encryption Libraries
  muse - sodium-native: not found
  muse - sodium: not found
  muse - libsodium-wrappers: 0.7.10
  muse - tweetnacl: not found
  muse
  muse FFmpeg
  muse - version: 2024-12-26-git-fe04b93afa-essentials_build-www.gyan.dev
  muse - libopus: yes
  muse -------------------------------------------------- +53ms
√ Ready! Invite the bot with *
  muse [WS => Shard 0] First heartbeat sent, starting to beat every 41250ms +7s
  muse [WS => Shard 0] Heartbeat acknowledged, latency of 104ms. +105ms
  muse DiscordAPIError[10062]: Unknown interaction
  muse     at handleErrors (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:640:13)
  muse     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
  muse     at async BurstHandler.runRequest (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:736:23)
  muse     at async REST.request (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:1387:22)
  muse     at async AutocompleteInteraction.respond (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\src\structures\AutocompleteInteraction.js:86:5)
  muse     at async play_default.handleAutocompleteInteraction (file:///C:/Users/Administrator/Documents/Servers/Discord/Bots/muse/src/commands/play.ts:1:2266)
  muse     at async Client.<anonymous> (file:///C:/Users/Administrator/Documents/Servers/Discord/Bots/muse/src/bot.ts:1:2747) +24s
  prisma:client  Prisma Client call: +31s
  prisma:client  prisma.setting.findUnique({
  where: {
    guildId: '504084859757658123'
  }
}) +1ms
  prisma:client  Generated request: +2ms
  prisma:client  query {
  findUniqueSetting(where: {
    guildId: "504084859757658123"
  }) {
    guildId
    playlistLimit
    secondsToWaitAfterQueueEmpties
    leaveIfNoListeners
    queueAddResponseEphemeral
    autoAnnounceNextSong
    defaultVolume
    defaultQueuePageSize
    turnDownVolumeWhenPeopleSpeak
    turnDownVolumeWhenPeopleSpeakTarget
    createdAt
    updatedAt
  }
}
 +1ms
  prisma:client:libraryEngine  sending request, this.libraryStarted: true +31s
  muse DiscordAPIError[10062]: Unknown interaction
  muse     at handleErrors (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:640:13)
  muse     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
  muse     at async BurstHandler.runRequest (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:736:23)
  muse     at async REST.request (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\node_modules\@discordjs\rest\dist\index.js:1387:22)
  muse     at async ChatInputCommandInteraction.deferReply (C:\Users\Administrator\Documents\Servers\Discord\Bots\muse\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
  muse     at async AddQueryToQueue.addToQueue (file:///C:/Users/Administrator/Documents/Servers/Discord/Bots/muse/src/services/add-query-to-queue.ts:1:1685)
  muse     at async play_default.execute (file:///C:/Users/Administrator/Documents/Servers/Discord/Bots/muse/src/commands/play.ts:1:1804)
  muse     at async Client.<anonymous> (file:///C:/Users/Administrator/Documents/Servers/Discord/Bots/muse/src/bot.ts:1:2354) +353ms
  muse [VOICE] received voice state update: {"member":{"user":{"username":"Sir Groovington Sixth","public_flags":0,"primary_guild":null,"id":"1120687496070696991","global_name":null,"display_name":null,"discriminator":"1867","clan":null,"bot":true,"avatar_decoration_data":null,"avatar":"f3915147436d7d16345e9c71ab715c02"},"roles":["796866399003607050","764496539405647952","851125948026716180","1120697640011706459","797603501022773310"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2023-06-20T12:17:45.584000+00:00","flags":0,"deaf":false,"communication_disabled_until":null,"banner":null,"avatar":null},"user_id":"1120687496070696991","suppress":false,"session_id":"60b6c81608f3d380b643f3306ad57b95","self_video":false,"self_mute":false,"self_deaf":false,"request_to_speak_timestamp":null,"mute":false,"guild_id":"504084859757658123","deaf":false,"channel_id":"718552122173685760"} +612ms
  muse [WS => Shard 0] Heartbeat acknowledged, latency of 112ms. +17s
  muse [VOICE] received voice state update: {"member":{"user":{"username":"Sir Groovington Sixth","public_flags":0,"primary_guild":null,"id":"1120687496070696991","global_name":null,"display_name":null,"discriminator":"1867","clan":null,"bot":true,"avatar_decoration_data":null,"avatar":"f3915147436d7d16345e9c71ab715c02"},"roles":["796866399003607050","764496539405647952","851125948026716180","1120697640011706459","797603501022773310"],"premium_since":null,"pending":false,"nick":null,"mute":false,"joined_at":"2023-06-20T12:17:45.584000+00:00","flags":0,"deaf":false,"communication_disabled_until":null,"banner":null,"avatar":null},"user_id":"1120687496070696991","suppress":false,"session_id":"60b6c81608f3d380b643f3306ad57b95","self_video":false,"self_mute":false,"self_deaf":false,"request_to_speak_timestamp":null,"mute":false,"guild_id":"504084859757658123","deaf":false,"channel_id":null} +14s

@WojenHere
Copy link

WojenHere commented Dec 30, 2024

If you are able to, please do the following. Add DEBUG=* to your env file, and then make a comment on this PR with your FULL log. Make sure to backtick your code

Just pulled pr-1180 to a new directory and run via docker compose up -d. Here is my docker-compose.yml:

services:
muse:
container_name: muse
image: ghcr.io/museofficial/muse:pr-1180
environment:
- SPOTIFY_CLIENT_ID=🤫
- SPOTIFY_CLIENT_SECRET=🤫
- YOUTUBE_API_KEY=🤫
- DISCORD_TOKEN=🤫
- BOT_ACTIVITY=🤫
- BOT_ACTIVITY_TYPE=PLAYING
- DEBUG=*
volumes:
- /home/user/muse/data:/data:rw
restart: unless-stopped

Tried 3 commands:

/play never gonna give you up

🚫 ope: no songs found

/play https://www.youtube.com/watch?v=dQw4w9WgXcQ

u betcha, Rick Astley - Never Gonna Give You Up (Official Music Video) added to the queue

Bot joined voice channel, waited few seconds and disconnected.

/play https://open.spotify.com/track/4PTG3Z6ehGkBFwjybzWkR8
Got message: App is not responding

Distro: Debian 12.8
Kernel: 6.1.0-28-amd64
Docker version: 20.10.24+dfsg1, build 297e128
Docker compose version: v2.29.7

Debug log in attachment
muse_debug.log

@Codixer
Copy link
Contributor Author

Codixer commented Jan 1, 2025

Hmmm, this is becoming an issue. It seems like the website used for playback is blocked. Did YT add a new auth system to their video's or something? Or at least their endpoints.
image

@Zereah
Copy link

Zereah commented Jan 2, 2025

I have a completely working installation of Muse at the moment. It plays music perfectly fine from Youtube and everything I've tried doing with it so far has worked without a hitch. But I'm going to apologize for my ignorance before I go any further.

I am extremely inexperienced to this level of CLI Application complexity (and this is pretty simple stuff I'm sure). Most of what's going on in this thread is way over my head. I found this bot on a whim while looking for a replacement to JMusicBot. , and it took me hours to even get the basic installation done through Docker. I couldn't even get the install command:

docker run -it -v "$(pwd)/data":/data -e DISCORD_TOKEN='' -e SPOTIFY_CLIENT_ID='' -e SPOTIFY_CLIENT_SECRET='' -e YOUTUBE_API_KEY='' ghcr.io/museofficial/muse:latest

to work no matter what I tried. I ended up cloning the latest Muse repository and building the image locally somehow, inputting the env variables in during runtime, and it just magically worked.

I'd love to help you guys troubleshoot...whatever it is that's going on... especially since I have a fully functional Muse installation as of this very moment. But I was genuinely unable to figure out how to even create an ENV file for the Docker container in the first place, much less get it to debug mode...

So that's the level of novice we're working with. I glanced at the package.json of the Muse repo I built the image off of, but I can't make heads or tails of what's the actual version number of anything since stuff appears multiple times with a slightly different version in each section of the .json.

Node is either:

"engines": {
     "node": ">=18.17.0"

or:

  "devDependencies": {
    "@types/node": "^17.0.0",
    "@types/node-emoji": "^1.8.1",

ffmpeg is either:

  "devDependencies": {   
    "@types/fluent-ffmpeg": "^2.1.17",`

or:

  "dependencies": {
    "fluent-ffmpeg": "^2.1.2",

ytdl-core only appears once. Not sure if ytsr is of any significance but there it is.

  "dependencies": {
    "@distube/ytdl-core": "^4.14.4",
    "@distube/ytsr": "^2.0.0",
    

If I can help further let me know, but don't waste more effort on me than it's worth. Sorry folks >.<.

@Codixer
Copy link
Contributor Author

Codixer commented Jan 3, 2025

@WojenHere think you could try by going to the latest branch and doing the same above, or by using a different api key.

@WojenHere
Copy link

@Codixer just tried again latest with the same above and pr-1182. Both with different new api keys. Still the same
pr-1182.log

@Zereah
Copy link

Zereah commented Jan 6, 2025

@Codixer
DEBUG new 2.txt
Working installation of Muse using a locally built image, based on the github codebase as of 12/24/24. Haven't swapped to using latest branch for fear of it breaking. I also still have the unaltered codebase used to build the image if that would be of any use.

@WojenHere
Copy link

WojenHere commented Jan 6, 2025

I also still have the unaltered codebase used to build the image if that would be of any use.

@Zereah Can you upload this somewhere and send a link to download?

@Zereah
Copy link

Zereah commented Jan 7, 2025

I also still have the unaltered codebase used to build the image if that would be of any use.

Can you upload this somewhere and send a link to download?

@WojenHere Sure thing. Haven't used a file share site in some time, hope MEGA is ok. https://mega.nz/file/U0dmzYYA#L0VLVvoHpKmMstNNDYsZCLn6AITs2zXpAXzgJhwR-sA

Hope it helps out in some way.

@WojenHere
Copy link

I also still have the unaltered codebase used to build the image if that would be of any use.

Can you upload this somewhere and send a link to download?

@WojenHere Sure thing. Haven't used a file share site in some time, hope MEGA is ok. https://mega.nz/file/U0dmzYYA#L0VLVvoHpKmMstNNDYsZCLn6AITs2zXpAXzgJhwR-sA

Hope it helps out in some way.

@Zereah
Thanks, but it still does not work. But if it works for you, can you push your working docker image on docker hub or somewhere else?

build.log
container.log

@Dezrin
Copy link

Dezrin commented Jan 9, 2025

Has a new build been pushed to DockerHub yet at all? Currently facing the playback issues and using latest image tag.

@Zereah
Copy link

Zereah commented Jan 11, 2025

I also still have the unaltered codebase used to build the image if that would be of any use.

Can you upload this somewhere and send a link to download?

@WojenHere Sure thing. Haven't used a file share site in some time, hope MEGA is ok. https://mega.nz/file/U0dmzYYA#L0VLVvoHpKmMstNNDYsZCLn6AITs2zXpAXzgJhwR-sA
Hope it helps out in some way.

@Zereah Thanks, but it still does not work. But if it works for you, can you push your working docker image on docker hub or somewhere else?

build.log container.log

@WojenHere Sorry for the late reply got busy with IRL and didn't have time to sit down and figure out Docker Hub. I pushed a newly built image that is also working to my hub here. Maybe you'll have better luck with that one?

Let me know if there's anything else I can try to help with.

@Zereah
Copy link

Zereah commented Jan 11, 2025

@WojenHere Sorry for the late reply got busy with IRL and didn't have time to sit down and figure out Docker Hub. I pushed a newly built image that is also working to my hub here. Maybe you'll have better luck with that one?
Let me know if there's anything else I can try to help with.

Thank you @Zereah, but still not working. A lot of discord.js problems in logs

muse | 2025-01-11T11:07:53.425Z muse DiscordAPIError[10062]: Unknown interaction
muse | at handleErrors (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:152:10)
muse | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
muse | at BurstHandler.runRequest (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:137:20)
muse | at REST.request (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/REST.ts:343:20)
muse | at async ChatInputCommandInteraction.deferReply (/usr/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:5)
muse | at AddQueryToQueue.addToQueue (/usr/app/src/services/add-query-to-queue.ts:60:5)
muse | at default_1.execute (/usr/app/src/commands/play.ts:58:5)
muse | at Client. (/usr/app/src/bot.ts:79:13)

I surrender...

Huh. I wonder why that is. Somehow I've got muse working, but only when it's my built image ran with my Docker and using my API keys to join and play on my server?

I'll leave it to the big brain folks to figure it out I guess. As always, let me know if I can maybe help at all, but mine just sounds like a fluke at this point...

@Codixer
Copy link
Contributor Author

Codixer commented Jan 16, 2025

Has a new build been pushed to DockerHub yet at all? Currently facing the playback issues and using latest image tag.

Trying to figure out why YT's being a bitch. But I'm getting stumped. It's like, working but in a superposition of both states of not working and working.

@Codixer
Copy link
Contributor Author

Codixer commented Jan 16, 2025

This is Schrodingers Muse

@Zereah
Copy link

Zereah commented Jan 18, 2025

Has a new build been pushed to DockerHub yet at all? Currently facing the playback issues and using latest image tag.

Trying to figure out why YT's being a bitch. But I'm getting stumped. It's like, working but in a superposition of both states of not working and working.

@Codixer Bit of info I stumbled into that may or may not be useful. Now having difficulty getting it to work in a friend's discord server, so I nuked the container/image and rebuilt using the github dump I still had. Tested it in my personal server first and it played music flawlessly. However upon moving the test back to the friend discord it broke again, so I scoured through the log trying to find anything notably different between the successful attempt and the failed one, and noticed this:

# Successful
2025-01-18 02:24:50 2025-01-18T07:24:50.764Z prisma:client:libraryEngine  sending request, this.libraryStarted: true
2025-01-18 02:24:50 2025-01-18T07:24:50.764Z muse [VOICE] received voice server: {"t":"VOICE_SERVER_UPDATE","s":11,"op":0,"d":{"token":"aa929b3375b81180","guild_id":"603320926821679104","endpoint":"us-central3466.discord.media:443"}}
2025-01-18 02:24:50 WARNING: @distube/ytdl-core is out of date! Update with "npm install @distube/ytdl-core@latest".
2025-01-18 02:24:51 2025-01-18T07:24:51.718Z muse Using format {
...
# Failed
2025-01-18 02:26:15 2025-01-18T07:26:15.758Z prisma:client:libraryEngine  sending request, this.libraryStarted: true
2025-01-18 02:26:16 WARNING: Could not parse n transform function.
2025-01-18 02:26:16 Please report this issue with the "1737185176648-base.js" file on https://github.com/distubejs/ytdl-core/issues.
2025-01-18 02:26:16 2025-01-18T07:26:16.663Z muse Using format {
...

I also noticed the cached yt video link is broken in the failed attempt, and fully functioning in the success. I realize that might be directly related to above warning/code failure, but I wanted to bring it up just in case it was somehow relevant.

Full log attached. Referenced code is at Line 574 and Line 1177, respectively. Best of luck getting to the bottom of it!

Muse Log.txt

@enigodupont
Copy link
Contributor

I downgraded to 4.15.4 today as well and videos that were failing on the latest ytdl-core are working now.

When I was investigating failed url's I was also experiencing 403's with certain links.

Here's a link that failed on latest,

https://rr2---sn-q4fl6n6d.googlevideo.com/videoplayback?expire=1737385766&ei=xhKOZ6enIKPBlu8PssPpwQ4&ip=REDACTED&id=o-AGZi5l01a9BO0WiKrXCFz8M4opN4SvcfrVungXmMYJeN&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&rms=au%2Cau&bui=AY2Et-NmB8qVagYugM0KePo0YY8VqPRsR-5Bwoz7eUAcqB8LBuKW-DKaAuaJq33qowy8-FZMdhy2bYJB&spc=9kzgDV73pd9eAnuJ4bS0k-mDXYyUL_xcmtG7EkpARmDmXUruojEuouGVmGSHc_fKanXoSCo&vprv=1&svpuc=1&mime=audio%2Fwebm&ns=f8ypzE8ZhTjtLgRclSTYwjUQ&rqh=1&gir=yes&clen=58533153&dur=3602.181&lmt=1737169144189206&keepalive=yes&fexp=24350590,24350737,24350827,24350859,24350961,24350975,51326932,51335594,51353498,51355912,51371294,51384461&c=WEB&sefc=1&txp=6432534&n=B7umocVSe1XXZQ&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Cns%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhALNnT2bviyq9ovbhN0KZYiBllN8lWRhY-KO6-gPJUcgtAiAx8HmVU36Zx89FaA4Jo_OdBnpJYQbxevwPvnzLAW6byg%3D%3D&redirect_counter=1&rm=sn-q4fez67l&rrc=104&req_id=d00ec777c1e1a3ee&cms_redirect=yes&cmsv=e&ipbypass=yes&met=1737364171,&mh=B0&mip=REDACTED&mm=31&mn=sn-q4fl6n6d&ms=au&mt=1737363657&mv=m&mvi=2&pl=42&lsparams=ipbypass,met,mh,mip,mm,mn,ms,mv,mvi,pl,rms&lsig=AGluJ3MwRgIhAJNYb4rZYhd9i-6CsP0utpcy1ambJMdEU_y1S9Adp39OAiEAni2drrOWXgQNpzo6VBW6G2KbQccBfLGfDSU6773Yuuw%3D

Here's the same link on 4.15.4,

https://rr3---sn-q4flrnss.googlevideo.com/videoplayback?expire=1737385558&ei=9hGOZ6yuGLSxlu8P0_eD2AY&ip=REDACTED&id=o-AHpU_yIrlXX4wGZQOMFxDP-juSGMt90GooJUG6NoHMDl&itag=251&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&rms=au%2Cau&bui=AY2Et-MM6oQZpH4M7Qdi8Ixi48nGW6lAe0uWTaEmgLKsY-pQLF_cmKa6aK9_RkxrBL0kzwPNM-lCROiX&spc=9kzgDehohlAahZzuhMU0q3hwxgsFxYcPlRt-11OzYXD9HnPGPgTtg27sHuNY&vprv=1&svpuc=1&mime=audio%2Fwebm&rqh=1&gir=yes&clen=58533153&dur=3602.181&lmt=1737169144189206&keepalive=yes&fexp=24350590,24350737,24350827,24350859,24350953,24350955,24350961,24350975,51326932,51335594,51353498,51371294,51384461&c=IOS&txp=6432534&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cxpc%2Cbui%2Cspc%2Cvprv%2Csvpuc%2Cmime%2Crqh%2Cgir%2Cclen%2Cdur%2Clmt&sig=AJfQdSswRQIhAMOclI_k8XKOhSfRQFykdCqtKf8BtQ7_hQM7oKygCDobAiBA7MluK5XxRlC3B-cL0B9Hu94Y3_hQoT9A8cxmZevNMg%3D%3D&redirect_counter=1&rm=sn-q4fesy7s&rrc=104&req_id=a9194c3466fca3ee&cms_redirect=yes&cmsv=e&ipbypass=yes&met=1737364135,&mh=B0&mip=REDACTED&mm=31&mn=sn-q4flrnss&ms=au&mt=1737363657&mv=m&mvi=3&pl=42&lsparams=ipbypass,met,mh,mip,mm,mn,ms,mv,mvi,pl,rms&lsig=AGluJ3MwRQIgag5SQpfokGYow6ei6IETROJlrejS9qCUHJ2kMexDVXsCIQCzXUUstpalB4uoCdmOIeeBEGeQYDSXUe93z2Mg1F0GpA%3D%3D

I've redacted my IP from both URL's, but I realize that the URL that worked for me doesn't work if I redact the IP from it.

I was taking a look at ytdl-core changes and it looks like they added a web client to the playerClients. Could that have broken how muse interacts with the library? distubejs/ytdl-core@4.15.4...4.15.8

I'm new to this project, so I'm still looking around the code base. Happy to help get it running, I need a new D&D music bot :P

@enigodupont
Copy link
Contributor

enigodupont commented Jan 20, 2025

I forked and created a branch where I reset the player clients using the latest version of ytdl 4.15.8 and it fixed the following link which was broken on master. https://www.youtube.com/watch?v=iNPzc932cs8

I'm hoping it works on more than just my machine, lmk if it doesn't.

ghcr.io/museofficial/muse:pr-1189

@WojenHere
Copy link

still got same error on pr-1189:

muse | 2025-01-20T19:37:10.334Z muse DiscordAPIError[10062]: Unknown interaction
muse | at handleErrors (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:152:10)
muse | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
muse | at BurstHandler.runRequest (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:137:20)
muse | at REST.request (/usr/app/node_modules/discord.js/node_modules/@discordjs/rest/src/lib/REST.ts:343:20)
muse | at async AutocompleteInteraction.respond (/usr/app/node_modules/discord.js/src/structures/AutocompleteInteraction.js:86:5)
muse | at default_1.handleAutocompleteInteraction (/usr/app/src/commands/play.ts:72:7)
muse | at Client. (/usr/app/src/bot.ts:99:13)

@enigodupont
Copy link
Contributor

@WojenHere Have you cleared your local data and deleted the container?

I'm updated the ytsr package now as well. Please try again using, ghcr.io/museofficial/muse:pr-1189

You will have to pull the image again to get the latest build, timestamp is around 2:24 CST.

I tried your test scenarios with querying and pasting links and both worked for me.

@enigodupont
Copy link
Contributor

@SparksSkywere If you're running on Windows, can you share what nodejs version you are using. I can try to replicate on my windows machine. Have you tried running via docker or WSL? ( That's my runtime env right now )

@SparksSkywere
Copy link

@enigodupont my Node.JS version is 22.12.0, I am not going to be using docker or WSL as if we fix the issue for just docker then no one else who has a different OS can use it.

image

@enigodupont
Copy link
Contributor

I'm surprised the install worked with 22.12, I am getting install errors due to OPUS not having compatible node packages for 22.12.0. The doc should say Node 18 is required as OPUS has versions available for version 18 and 19.

https://github.com/discordjs/opus/releases

I was able to build with v18.20.6 and run the bot on windows.

I've been getting issues with the formats not being pulled by ytdl-core so I'll look into that. It's not working for me anymore since the API isn't returning formats :(

@enigodupont
Copy link
Contributor

enigodupont commented Jan 22, 2025

I found that ytdl-core seems to have busted how formats are parsed when using the old default player clients.

I also found that when we do obtain formats, the OPUS url's tend to get 403's.

EDIT: Not all other media types work fine, I'm getting mixed results when I try to click them. Sometimes they work, sometimes they don't.

@fenneltheloon
Copy link

Wanted to jump in and say that I'm experiencing the issues mentioned in #1173 #1166 using the pr-1189 image.

Here's the logfile: https://0x0.st/8XoH.txt

@SparksSkywere
Copy link

@enigodupont The funny thing about why my version is this is because on the same day as my final server migration was going on moving to the new host I was getting all subsystems back in and happens the Discord bot stopped working, I spent a couple days just checking if it was my server!

@Nerijusas
Copy link

Wouldn't be better to migrate from @distube/ytdl-core to yt-dlp executable as it is more stable?

@Codixer
Copy link
Contributor Author

Codixer commented Jan 24, 2025

Wouldn't be better to migrate from @distube/ytdl-core to yt-dlp executable as it is more stable?

If you know someone who has experience with yt-dlp code, please help xD

@Zereah
Copy link

Zereah commented Jan 24, 2025

What an utterly bizarre journey this has been, especially as such a novice. My previously working bot using a much older branch has now also stopped working, experiencing the same issues as most others, #1173 #1166, despite ostensibly changing nothing with the setup. It appears to be malformed/broken URLs from either ytdl or ffmpeg, as they do not lead anywhere when clicked. The last time a bot worked, I could click on the cached URL and it was a valid embed playing. But I don't understand why a previously working image would suddenly stop working with no alterations on my end.

@enigodupont 's pr-1189 image is also non-functioning for me, but is returning a 🚫 ope: Can't find suitable format. without even spawning ffmpeg first.

Not sure which one is even closer to working at this point. Just sharing my experience in hopes it leads someone to something.

@enigodupont
Copy link
Contributor

If I had to guess, I'd assume api calls are breaking because youtube is changing their API's right now and ytdl-core is working on accommodating the changes.

I'm following this for updates, so once their changes are merged I can try to incorporate them. Looks like playerclients and how formats are handled are undergoing significant changes.

distubejs/ytdl-core#163

@enigodupont
Copy link
Contributor

I pulled in the changes upstream in this PR, #1197

As of writing it's working for me in my servers. Please give it a try when y'all can.

ghcr.io/museofficial/muse:pr-1197

@WojenHere
Copy link

WojenHere commented Jan 25, 2025

@enigodupont still not working for me on docker compose. Checked with new discord bot profile on few discord servers and on a new server

https://0x0.st/8X_k.log

@WojenHere
Copy link

I just tried to use commands without autocomplete (/clear and /config get). Still shows "App is not responding" on discord and Unknown interaction in bot logs

@enigodupont
Copy link
Contributor

Hmm, you're running this on a homelab somewhere right? Does this happen on all machines you run this on?

@WojenHere
Copy link

WojenHere commented Jan 25, 2025

Maybe I used the wrong words when calling my machine ‘homelab’. By 'homelab' i mean my little dell optiplex connected to my router where I run Debian with docker, I'm not using VMs

@WojenHere
Copy link

WojenHere commented Jan 25, 2025

@enigodupont got it worked sometimes. Steps to reproduce:

  1. Type /play and press space or tab
  2. Wait ~5 seconds
  3. Type song name
  4. Wait ~5 seconds
  5. Press enter

Bot works very slow, it takes about a minute to "think", join voice channel and start playing. Works with typing song name and pasting youtube link. Spotify links don't work.

Autocomplete does not work either, after 3 seconds shows "Loading options failed"

Logs here: https://pastebin.com/zSDLCYRy

@enigodupont
Copy link
Contributor

Do you have other machines available for testing purposes? What happens if you install node and yarn, then run locally using yarn install + yarn start?

@enigodupont
Copy link
Contributor

Interesting, I'm wonder if docker is putting limits on your container that's causing it to run too slowly for discord api's to respond quickly enough?

I was doing some testing on my homelab and I found that performance dipped when I gave it .25 CPU and 128Mi of RAM.

I found a sweet-spot with .5 CPU and 400Mi of ram.

@WojenHere
Copy link

WojenHere commented Jan 25, 2025

What happens if you install node and yarn, then run locally using yarn install + yarn start?

Can't help right now, The earliest I will be home is Tuesday. I can check it but not in the same network and device.

@WojenHere
Copy link

I found a sweet-spot with .5 CPU and 400Mi of ram.

set to 2 cpu and 1024m ram, still the same result

@SparksSkywere
Copy link

@enigodupont Sadly the issue persists, I did a fresh install again, my only thought is ffmpeg being bad or something along those lines.

@enigodupont
Copy link
Contributor

Here's what worked for me on WIN 11, using powershell to run "yarn install and yarn start".

~\Desktop\Working_On\Code_Projects\muse $ node --version
v18.20.6
~\Desktop\Working_On\Code_Projects\muse $ yarn --version
1.22.22

  muse --------------------------------------------------
  muse Core Dependencies
  muse - @discordjs/voice: 0.17.0
  muse - prism-media: 1.3.5
  muse
  muse Opus Libraries
  muse - @discordjs/opus: 0.8.0
  muse - opusscript: not found
  muse
  muse Encryption Libraries
  muse - sodium-native: not found
  muse - sodium: not found
  muse - libsodium-wrappers: 0.7.10
  muse - tweetnacl: not found
  muse
  muse FFmpeg
  muse - version: 7.1-essentials_build-www.gyan.dev
  muse - libopus: yes
  muse -------------------------------------------------- 

@SparksSkywere
Copy link

I am using npm install, let me give yarn a go now

@SparksSkywere
Copy link

@enigodupont Same result for both NPM and YARN, however I have a special cmd file I use to start the npm as it will cause the error "muse Error: Cannot find module 'node-opus'" otherwise, I wonder if my ffmpeg is broken! What version of ffmpeg are you using? Mine is

"ffmpeg version 2024-12-26-git-fe04b93afa-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14.2.0 (Rev1, Built by MSYS2 project)"

@enigodupont
Copy link
Contributor

enigodupont commented Jan 25, 2025

I have the following

~\Desktop\Working_On\Code_Projects\muse $ ffmpeg -version
ffmpeg version 7.1-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers

I recommend using the following node,

v18.20.6

EDIT: I do think to get it working you need to download node-opus which requires node 18

EDIT: This information is from my local install on windows, not docker.

@Zereah
Copy link

Zereah commented Jan 26, 2025

I pulled in the changes upstream in this PR, #1197

As of writing it's working for me in my servers. Please give it a try when y'all can.

ghcr.io/museofficial/muse:pr-1197

@enigodupont Muse is now working for me in all servers using pr-1197 and no other changes. I'm still using an extremely old version of ffmpeg

image

but I'm too dumb to figure out how to run the pulled image with newer version I have that you suggested, or where it keeps getting that version from, but it's working anyway so I'm afraid to touch anything.

@enigodupont
Copy link
Contributor

Happy to hear its working! I added some context in my previous comment, but the ffmpeg I'm running is on my windows machine. The one you are running is in docker and I believe I run the same thing when I run docker.

Should work with both versions so I wouldn't worry about it for now.

@Zereah
Copy link

Zereah commented Jan 26, 2025

Happy to hear its working! I added some context in my previous comment, but the ffmpeg I'm running is on my windows machine. The one you are running is in docker and I believe I run the same thing when I run docker.

Should work with both versions so I wouldn't worry about it for now.

Thanks for the clarification, not sure why Docker is using a version that's 4 or 5 releases behind, but that's a problem for another time.

@SparksSkywere
Copy link

I GOT IT TO PLAY!

I went and gone through my home PC for any old codex's I had, now I had a copy of ffmpeg from 2021 for some old copies of my teamspeak and audacity files with these .exe files, after that I made a new folder and inputted all the usual install scripts but did a full upgrade with forcing any and all to upgrade, after doing so it worked!

PS C:\Users\%USERNAME%\Documents\servers\discord\bots\muse> npm install @distube/ytdl-core@latest
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '[email protected]',
npm warn EBADENGINE   required: { node: '^20.9.0 || >=22.0.0' },
npm warn EBADENGINE   current: { node: 'v18.20.6', npm: '10.8.2' }
npm warn EBADENGINE }

changed 1 package, and audited 725 packages in 4s

235 packages are looking for funding
  run `npm fund` for details

3 vulnerabilities (2 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
PS C:\Users\%USERNAME%\Documents\servers\discord\bots\muse> npm audit fix --force
npm warn using --force Recommended protections disabled.
npm warn audit Updating @discordjs/opus to 0.10.0, which is a SemVer major change.

added 2 packages, removed 1 package, changed 7 packages, and audited 726 packages in 11s

235 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
"ffmpeg version n4.4-78-g031c0cb0b4-20210718 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10-win32 (GCC) 20210408"

I then re-upgraded the ffmpeg back to the latest copy I had and it still worked! My only guess was something to do with the npm modules? But either way I have it all working now :D

@SparksSkywere
Copy link

Update:

I have done further experiments, the 2021 version of ffmpeg I have works better than the latest

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