Scrape YouTube Videos with Python and Selenium

牧云@^-^@ 提交于 2021-01-29 09:13:05

问题


I want to Scrape all Videos from 'TVFilthyFrank' for a friend. I have all links to every video of him. I want to measure the size in MB for all videos now and download them. I know I can just say driver.get(VIDEO_URL) and then just get the src out of the player but that would take very long and wouldt look nice. Is there anyway to get the video src (or at least some information to the vid) out of the video link ?


回答1:


You should try youtube-dl: https://github.com/ytdl-org/youtube-dl. It can be used in python code as modude and in shell.

To download all videos from channel TVFilthyFrank you can use youtube-dl -f bestvideo+bestaudio --write-info-json https://www.youtube.com/user/TVFilthyFrank (-f bestvideo+bestaudio means the best quality). --write-info-json means save metadata to json file.



来源:https://stackoverflow.com/questions/62129727/scrape-youtube-videos-with-python-and-selenium

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!