-
Notifications
You must be signed in to change notification settings - Fork 801
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
[Feature request] YouTube Live Stream Audio Only #925
Comments
Added a delay for 5 seconds
Now I got a continuous audio, but there is some missing audio part which was skipped due to unsynchronized requests. |
i'd expect some kinda header to track which range to get 🤔 |
if you try 1 request and bump the result to a file and open it, you can see at the beginning some header information and then the audio data. |
results:
seems it works, now I'm trying to make a callback on end event and make another request. |
same result, repetitive audio. |
The response consists of 5 chunks, each one has a length about 16384 bytes (it differs), so the first chunk is the MP4 header info like the moov and stts. we need to parse those header info so that we can know the 'end' offset. |
I tried to increase 'X-Sequence-Num' by 1 on nextChunk requests, it gives me the same response but after like 7 requests i get new audio. |
parsing the MP4 headers, no byte range found. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hello again, |
Hello,
as we all know, when requesting 'audio only' from node-ytdl, it will gives us a URL which is a chunk of 5 seconds audio playable directly from the browser. so the problem is we have to make a new request every < 5 seconds to get new audio.
I tried to implement a mechanism where using Axios in a loop with a circular buffer, when getting a response, data will be pushed to the buffer and then write it to a WriteStream (a local file).
The result was a bit unreliable, i was able to play it on VLC not on other players because data headers was also pushed with the chunks. when playing, i can hear duplicate samples ex. the first 15s are the same as the original first 5s request but duplicated, which made me think that YouTube will gives you the same audio if the request was not buffered or played completely or the request time was a bit early, like if we make 2 requests under 2 seconds we will get the same response. Anyway let's see what we can accomplish with that and with the help of anyone who is interested playing audio from a live stream because we all want to save some bandwidth and want to listen to music without watching while working.
Here is some of my implementations:
The text was updated successfully, but these errors were encountered: