Get audio from Youtube Live Streaming

3

Is there any way to get ONLY the url of the audio track of a live YouTube broadcast?

I'm trying with the Pafy and Youtube-dl libraries but I only get mp4 files, there are no m4a files like in the rest of the videos.

streams = video.audiostreams
for a in streams:
    print(a.bitrate, a.extension, a.get_filesize())

This does not return anything.

Is there an alternative? Or simply Youtube does not provide m4a files for direct ones? And if this is the reason ... would there be a way to get it?

Any ideas?

Thank you!

    
asked by EirisDG 04.07.2017 в 22:35
source

1 answer

0

try with pytube link

>>> yt = YouTube('http://youtube.co/watch?v=9bZkp7q19f0')

>>> yt.streams.all()
 [...
  ...
  ...
 <Stream: itag="278" mime_type="video/webm" res="144p" fps="30fps" vcodec="vp9">,
 <Stream: itag="140" mime_type="audio/mp4" abr="128kbps" acodec="mp4a.40.2">,
 <Stream: itag="171" mime_type="audio/webm" abr="128kbps" acodec="vorbis">,
 <Stream: itag="249" mime_type="audio/webm" abr="50kbps" acodec="opus">,
 <Stream: itag="250" mime_type="audio/webm" abr="70kbps" acodec="opus">,
 <Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus">]
    
answered by 04.10.2018 в 01:45