Youtube: Download Video dengan pytube
Revision as of 12:22, 4 May 2024 by Onnowpurbo (talk | contribs)
Sumber: https://github.com/pytube/pytube
sudo su apt install git python3 -m pip install git+https://github.com/pytube/pytube
Penggunaan
pytube https://youtube.com/watch?v=2lAe1cqCOXo pytube https://www.youtube.com/playlist?list=PLS1QulWo1RIaJECMeUT4LFwJ-ghgoSH6n
List URL di playlist
from pytube import Playlist playlist = Playlist('https://www.youtube.com/playlist?list=PLXHnX-wg99aweNBbJAhNkgiIFLxhWjTS-') playlist._video_regex = re.compile(r"\"url\":\"(/watch\?v=[\w-]*)") print(len(playlist.video_urls)) for url in playlist.video_urls: print(url) <enter>