Closed devoxin closed 8 months ago
If possible, could you send an example so that I can reproduce it?
Although I will try with FastLink, our client, it may not reproduce it, as I never found this issue.
This is weird. This would only happen if your client sent a pause request, which doesn't appear in the NodeLink logging.
Still, this is still an issue because it shouldn't try to pause while it's not even playing. I'll send the commit with the fix soon.
It's weird to see a LL collaborator trying out NodeLink. Thank you anyway, contributions to NodeLink are contributions to the Open Source world.
If possible, could you send an example so that I can reproduce it?
Although I will try with FastLink, our client, it may not reproduce it, as I never found this issue.
Difficult to do so as the code is fairly abstract and split up. I don't really do anything specific that I feel would trigger it. I just connect via WS as I usually would, load a track by requesting the loadtracks
endpoint, send a playerUpdate
with a voice state, and then a second playerUpdate
with a base64 track string.
I've identified a slight issue in that my library was always sending startTime
and paused
values due to incorrect default parameters, when calling player.play()
, regardless of whether the user specified them or not. Although I wouldn't have thought this should be the cause of the issues as the exception being thrown by NodeLink indicates there is no websocket connection to action on, which looks to be erroneous -- there should be a websocket connection
NodeLink works a little differently than LavaLink internally. It will only create a websocket connection with Discord once a play is requested. Although it should never throw an error. This will be fixed soon anyway. Thanks.
Could you try the fix/paused-crash
branch?
Could you try the
fix/paused-crash
branch?
This appears to have fixed the crashing but not the underlying problem of not having a websocket connection. Trying to play a track yields nothing; no audio, no errors, no logs.
Client logs:
[2023-12-21 20:27:42,255][lavalink.transport:125 - INFO ] [Node:nodelink] Establishing WebSocket connection to Lavalink...
[2023-12-21 20:27:42,266][lavalink.transport:160 - INFO ] [Node:nodelink] WebSocket connection established
NodeLink logs:
devoxin@trinity:~/NodeLink$ npm start
> start
> node src/connection/index.js
[websocket]: Listening on port 2333.
[innertube]: Fetching deciphering functions...
[spotify]: Fetching token...
[websocket]: Lavalink.py/5.2.0 client connected to NodeLink.
[voice]: Received a request from client.
Headers: {"host":"127.0.0.1:2333","authorization":"youshallnotpass","accept":"*/*","accept-encoding":"gzip, deflate","user-agent":"Python/3.11 aiohttp/3.8.6","content-length":"134","content-type":"application/json"}
Body: {"voice":{"sessionId":"8a6b9d7c2efaff90f8c114546764019e","endpoint":"us-east9194.discord.media:443","token":"72c0ffb72492b4b7"}}
[spotify]: Successfully fetched token.
[innertube]: Successfully fetched deciphering functions.
[loadtracks]: Received a request from client.
Params: "?identifier=ytmsearch:ummet+ozcan+wonderful+days"
Headers: {"host":"127.0.0.1:2333","authorization":"youshallnotpass","accept":"*/*","accept-encoding":"gzip, deflate","user-agent":"Python/3.11 aiohttp/3.8.6"}
[search]: Searching for ummet ozcan wonderful days on YouTube
[search]: Found 19 tracks on YouTube for query ummet ozcan wonderful days
I do not even receive a TrackStartEvent
which should trigger my bot to display the currently playing song.
According to the NodeLink logs, a play request was not done. Could you verify if your client is really sending a play request?
NodeLink logs?
There are none. I've figured out the problem, anyway:
I'm PATCH
ing the player with buffer.track.encoded
whereas NodeLink is looking for buffer.encodedTrack
which has been deprecated. This needs changing to check buffer.track.{encoded, identifier}
as per the Lavalink REST documentation if compatibility with Lavalink clients is to be ensured.
Can't keep on with all LavaLink changes, sorry.
Do you want to open a PR, or can I?
I'll let you tend to it as it looks like a bit of refactoring will need to happen to support this change.
Done, this is fixed, and also: userData added!
Try the update-add/encodedTrack-userData
branch.
Same thing, still not working. Although this time, I'm now seeing the addition of this in my logs:
[stop]: Received a request from client.
Oops! It should work properly now.
NodeLink version
1.15.0, cloned directly from the
main
branch.Description
I can connect to the server, load tracks with it etc. I've connected to a voice channel but upon trying to play a track I receive an error.
Client
Lavalink.py 5.2.0
Steps to reproduce
Example code
N/A (Python)
Confirmations
Code of Conduct