Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Saturday, June 25, 2011

YouTube audio retrieval for Python

I am currently working on a project that requires audio retrieval from YouTube videos. So I wanted a batch processing program, that given a string query "Artist name - song title", it would retrieve the audio from the first N matches.
    The following figure shows the GUI for the code I wrote. You can just define the query string and the number of the retrieved videos (their audio actually).


Regarding the dependencies:
The whole code is based on youtube_dl, which I modified so as to act a callable function, rather as a command prompt program. The script requires the ffprobe and ffmpeg executables.