with ydl:
    result = ydl.extract_info('http://www.youtube.com/watch?v=BaW_jenozKc',
        download=False)
if 'entries' in result:
    video = result['entries'][0]
else:
    video = result
print(video)
video_url = video['url']
print(video_url)
Как использовать youtube-dl из программы на python