Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
use pytube library to download the video, then use ffmpeg on your machine to extract audio from the video stream, then you can use pydub to extract specific audio fragments or you can try the same with ffmpeg itself
2nd Nov 2019, 12:23 PM
Dev Project
Dev Project - avatar
+ 1
Sayantan well, you will most likely need to download the entire file. i doubt youtube easily supports chunked downloads. see this tool too, which yiu can start as a process from any python https://askubuntu.com/questions/178481/how-to-download-an-mp3-track-from-a-youtube-video then call ffmpeg as a process from python https://stackoverflow.com/questions/20295398/ffmpeg-clip-audio-interval-with-starting-and-end-time
5th Nov 2019, 9:40 AM
Dev Project
Dev Project - avatar