Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: latin-1 -*-
- """
- YouTube downloader lista y simple Antonio Villanueva Segura
- usando la libreria pytube
- https://github.com/pytube/pytube?fbclid=IwAR1T-KnFOsFrYdbBRZ3U7zUGwcuT-ESZO2TGIL1RLPIKuxY0BZ1JbFol6s0
- https://www.youtube.com/watch?v=e-ORhEE9VVg
- """
- from pytube import YouTube
- from pytube import Playlist
- def main():
- http =input(str("Introduzca direccion YouTube a descargar :"))
- contador=0
- #Detecta si es una lista o un video simple
- if ("list" in http):
- print ("Lista :\n")
- listaVideos = Playlist (http)
- for video in listaVideos.videos:
- print ("Descargando n :"+str(contador)+'\n')
- #YouTube(video).streams.first().download
- video.streams.first().download()
- contador+=1
- else:
- print ("Descargando "+http);
- YouTube(http).streams.first().download()
- if __name__ =='__main__':main()
Add Comment
Please, Sign In to add comment