muse icon indicating copy to clipboard operation
muse copied to clipboard

Update distube dependencies for improved YouTube support

Open Xeravax opened this issue 1 year ago • 83 comments

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

  • [x] Updated Distube

Xeravax avatar Dec 29 '24 20:12 Xeravax

:package: :robot: 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: 98fdd3fdf9753e2aed250105d56ffc672f24cc51

codetheweb avatar Dec 29 '24 20:12 codetheweb

@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 https://github.com/distubejs/ytdl-core/issues/157 https://github.com/distubejs/ytdl-core/issues/156 and https://github.com/distubejs/ytdl-core/issues/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.

Xeravax avatar Dec 29 '24 22:12 Xeravax

@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 https://github.com/distubejs/ytdl-core/issues/157 https://github.com/distubejs/ytdl-core/issues/156 and https://github.com/distubejs/ytdl-core/issues/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.

QuintenQVD0 avatar Dec 29 '24 22:12 QuintenQVD0

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

DaanSelen avatar Dec 29 '24 22:12 DaanSelen

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).

Xeravax avatar Dec 29 '24 22:12 Xeravax

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!

DaanSelen avatar Dec 29 '24 22:12 DaanSelen

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.

cwerdna19 avatar Dec 29 '24 23:12 cwerdna19

@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...

Xeravax avatar Dec 29 '24 23:12 Xeravax

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

SparksSkywere avatar Dec 30 '24 00:12 SparksSkywere

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

WojenHere avatar Dec 30 '24 00:12 WojenHere

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

Xeravax avatar Jan 01 '25 17:01 Xeravax

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 >.<.

Zereah avatar Jan 02 '25 01:01 Zereah

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

Xeravax avatar Jan 03 '25 19:01 Xeravax

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

WojenHere avatar Jan 03 '25 21:01 WojenHere

@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.

Zereah avatar Jan 06 '25 05:01 Zereah

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?

WojenHere avatar Jan 06 '25 19:01 WojenHere

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 avatar Jan 07 '25 06:01 Zereah

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 avatar Jan 07 '25 13:01 WojenHere

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

Dezrin avatar Jan 09 '25 15:01 Dezrin

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 avatar Jan 11 '25 07:01 Zereah

@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...

Zereah avatar Jan 11 '25 11:01 Zereah

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.

Xeravax avatar Jan 16 '25 23:01 Xeravax

This is Schrodingers Muse

Xeravax avatar Jan 16 '25 23:01 Xeravax

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

Zereah avatar Jan 18 '25 07:01 Zereah

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? https://github.com/distubejs/ytdl-core/compare/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 avatar Jan 20 '25 09:01 enigodupont

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

enigodupont avatar Jan 20 '25 09:01 enigodupont

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)

WojenHere avatar Jan 20 '25 19:01 WojenHere

@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 avatar Jan 20 '25 20:01 enigodupont

@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 Ok, maybe I'm doing something wrong. Below is what I'm doing:

cd muse docker compose down sudo rm -rf data docker rmi ghcr.io/museofficial/muse:pr-1187 docker compose up -d

Started pulling, running, same reaction.

EDIT: I'm using same docker-compose.yml like here https://github.com/museofficial/muse/pull/1180#issuecomment-2564883385 but changed from pr-1180 to pr-1187

WojenHere avatar Jan 20 '25 20:01 WojenHere

Your steps should work, your log suggests that it's a Discord specific error.

Perhaps create a new server and test the bot there?

Could be that your permissions are wrong for the bot in discord.

My changes only address the youtube link errors I was seeing.

enigodupont avatar Jan 20 '25 20:01 enigodupont