Я пытаюсь перенести Librespot-java в C# для какого-то проекта в будущем, но я столкнулся с проблемой, когда только рукопожатие работает правильно. https://github.com/werwolf2303/librespo ... air.cs#l70.
Это консольный выход:
2025-06-23 22:53:56,126 [1] DEBUG lib.core.TimeProvider - Loaded time offset from NTP: 0ms
2025-06-23 22:53:56,254 [1] INFO lib.core.ApResolver - Loaded aps into pool: { "accesspoint": ["ap-gew4.spotify.com:4070", "ap-gew4.spotify.com:443", "ap-gew4.spotify.com:80", "ap-guc3.spotify.com:4070", "ap-gue1.spotify.com:443", "ap-gew1.spotify.com:80"], "dealer": ["gew4-dealer.spotify.com:443", "guc3-dealer.spotify.com:443", "gue1-dealer.spotify.com:443", "gew1-dealer.spotify.com:443"], "spclient": ["gew4-spclient.spotify.com:443", "guc3-spclient.spotify.com:443", "gue1-spclient.spotify.com:443", "gew1-spclient.spotify.com:443"]}
2025-06-23 22:53:56,277 [1] INFO lib.core.Session - Created new session! (deviceId: fd8f049e6c6c07a49bfde5df909072ab3819c4c0, ap: ap-gew4.spotify.com:80, proxy: False)
20
2025-06-23 22:53:56,716 [1] INFO lib.core.Session - Connected successfully!
Login
Len: 356
Unhandled Exception:
System.IO.EndOfStreamException: Stream ended before reading expected bytes
at BinaryReaderExtensions.ReadFully (System.IO.BinaryReader reader, System.Byte[] buffer) [0x00045] in :0
at lib.crypto.CipherPair.ReceiveEncoded (System.IO.BinaryReader reader) [0x00040] in :0
at lib.core.Session.authenticatePartial (Spotify.LoginCredentials credentials, System.Boolean removeLock) [0x0009a] in :0
at lib.core.Session.authenticate (Spotify.LoginCredentials loginCredentials) [0x00001] in :0
at lib.core.Session+Builder.create () [0x00055] in :0
at librespot.Program.Main (System.String[] args) [0x0009c] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.EndOfStreamException: Stream ended before reading expected bytes
at BinaryReaderExtensions.ReadFully (System.IO.BinaryReader reader, System.Byte[] buffer) [0x00045] in :0
at lib.crypto.CipherPair.ReceiveEncoded (System.IO.BinaryReader reader) [0x00040] in :0
at lib.core.Session.authenticatePartial (Spotify.LoginCredentials credentials, System.Boolean removeLock) [0x0009a] in :0
at lib.core.Session.authenticate (Spotify.LoginCredentials loginCredentials) [0x00001] in :0
at lib.core.Session+Builder.create () [0x00055] in :0
at librespot.Program.Main (System.String[] args) [0x0009c] in :0
Я уже проверил все, включая Big/Little Endian. Когда я изменяю переменную задачи, сервер отвечает ошибкой Badcredentials, поэтому я думаю, что у меня есть первоначальная часть соединения.>
Я пытаюсь перенести Librespot-java в C# для какого-то проекта в будущем, но я столкнулся с проблемой, когда только рукопожатие работает правильно. https://github.com/werwolf2303/librespot-csharp/blob/master/lib/crypto/cipherpair.cs#l70. Это консольный выход: [code]2025-06-23 22:53:56,126 [1] DEBUG lib.core.TimeProvider - Loaded time offset from NTP: 0ms 2025-06-23 22:53:56,254 [1] INFO lib.core.ApResolver - Loaded aps into pool: { "accesspoint": ["ap-gew4.spotify.com:4070", "ap-gew4.spotify.com:443", "ap-gew4.spotify.com:80", "ap-guc3.spotify.com:4070", "ap-gue1.spotify.com:443", "ap-gew1.spotify.com:80"], "dealer": ["gew4-dealer.spotify.com:443", "guc3-dealer.spotify.com:443", "gue1-dealer.spotify.com:443", "gew1-dealer.spotify.com:443"], "spclient": ["gew4-spclient.spotify.com:443", "guc3-spclient.spotify.com:443", "gue1-spclient.spotify.com:443", "gew1-spclient.spotify.com:443"]} 2025-06-23 22:53:56,277 [1] INFO lib.core.Session - Created new session! (deviceId: fd8f049e6c6c07a49bfde5df909072ab3819c4c0, ap: ap-gew4.spotify.com:80, proxy: False) 20 2025-06-23 22:53:56,716 [1] INFO lib.core.Session - Connected successfully! Login Len: 356
Unhandled Exception: System.IO.EndOfStreamException: Stream ended before reading expected bytes at BinaryReaderExtensions.ReadFully (System.IO.BinaryReader reader, System.Byte[] buffer) [0x00045] in :0 at lib.crypto.CipherPair.ReceiveEncoded (System.IO.BinaryReader reader) [0x00040] in :0 at lib.core.Session.authenticatePartial (Spotify.LoginCredentials credentials, System.Boolean removeLock) [0x0009a] in :0 at lib.core.Session.authenticate (Spotify.LoginCredentials loginCredentials) [0x00001] in :0 at lib.core.Session+Builder.create () [0x00055] in :0 at librespot.Program.Main (System.String[] args) [0x0009c] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.EndOfStreamException: Stream ended before reading expected bytes at BinaryReaderExtensions.ReadFully (System.IO.BinaryReader reader, System.Byte[] buffer) [0x00045] in :0 at lib.crypto.CipherPair.ReceiveEncoded (System.IO.BinaryReader reader) [0x00040] in :0 at lib.core.Session.authenticatePartial (Spotify.LoginCredentials credentials, System.Boolean removeLock) [0x0009a] in :0 at lib.core.Session.authenticate (Spotify.LoginCredentials loginCredentials) [0x00001] in :0 at lib.core.Session+Builder.create () [0x00055] in :0 at librespot.Program.Main (System.String[] args) [0x0009c] in :0 [/code] Я уже проверил все, включая Big/Little Endian. Когда я изменяю переменную задачи, сервер отвечает ошибкой Badcredentials, поэтому я думаю, что у меня есть первоначальная часть соединения.>