codealchemist / youtube-audio-server

Easily stream and download audio from YouTube.
75 stars 32 forks source link

Chunk Feature is Broken #48

Open DavidBerdik opened 2 years ago

DavidBerdik commented 2 years ago

Attempting to use the /chunk/[videoId] endpoint to stream audio appears to be extremely broken. Each time an attempt is made to load a stream using the chunk endpoint, the audio is totally redownloaded even if the audio was downloaded previously and could therefore be loaded in to the stream from the saved copy. This does not just happen when loading a new stream, but also occurs when attempting to seek within the stream.

Another thing that I think would be a good idea is, instead of waiting for the audio to download to completion before starting the stream, the stream playback against the file should be started immediately. I understand that this would prevent seeking the entire track from being possible when the initial download of the audio is taking place, but it is still a friendlier user experience than waiting for the entire track to download before loading. And besides, this would only occur on the initial download. On subsequent playback, seeking would be available immediately.