
这并不困难,实际上已记录在案:
import youtube_dlydl = youtube_dl.YoutubeDL({'outtmpl': '%(id)s.%(ext)s'})with ydl: result = ydl.extract_info( 'http://www.youtube.com/watch?v=BaW_jenozKc', download=False # We just want to extract the info )if 'entries' in result: # Can be a playlist or a list of videos video = result['entries'][0]else: # Just a video video = resultprint(video)video_url = video['url']print(video_url)欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)