【爬虫】下载网络视频的三种工具及代码

annie

https://ywnz.com/linuxrj/4166.html

youtube-dl


安装

sudo pip install youtube-dl
sudo -H pip install --upgrade youtube-dl

根据链接下载视频

youtube 根据链接获取playlist

playlist_ydl_opts = {'extract_flat':'in_playlist', 'ignoreerrors': True, 'nocheckcertificate':True}
playlist_ydl = YoutubeDL(playlist_ydl_opts)
playlist_ydl.add_default_info_extractors()
playlist = playlist_ydl.extract_info(playlist_path, download = False)
if playlist.has_key('entries') and playlist['entries'] != None:

参考

https://blog.csdn.net/lsy673807439/article/details/104279057

you-get

你可能感兴趣的:(【爬虫】)