AntonioVillanueva

YouTube Downloader Version II

Jan 16th, 2021 (edited)
1,456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: latin-1 -*-
  3. """  
  4.    YouTube downloader lista y simple Antonio Villanueva Segura
  5.    usando la libreria pytube
  6.    https://github.com/pytube/pytube?fbclid=IwAR1T-KnFOsFrYdbBRZ3U7zUGwcuT-ESZO2TGIL1RLPIKuxY0BZ1JbFol6s0
  7.    https://www.youtube.com/watch?v=e-ORhEE9VVg
  8.    
  9. """
  10. from pytube import YouTube
  11. from pytube import Playlist
  12.  
  13. def main():
  14.    
  15.     http =input(str("Introduzca direccion YouTube a descargar :"))
  16.     contador=0
  17.    
  18.     #Detecta si es una lista o un video simple
  19.     if ("list" in http):
  20.        
  21.         print ("Lista :\n")
  22.         listaVideos = Playlist (http)
  23.        
  24.         for video in listaVideos.videos:
  25.             print ("Descargando n :"+str(contador)+'\n')
  26.             #YouTube(video).streams.first().download
  27.             video.streams.first().download()
  28.             contador+=1
  29.                      
  30.     else:
  31.         print ("Descargando "+http);            
  32.         YouTube(http).streams.first().download()
  33.  
  34.  
  35. if  __name__ =='__main__':main()
Add Comment
Please, Sign In to add comment