66
77class YouTubeDownloder :
88 def __init__ (self ):
9- self .url = str (input ("Enter the url of video : " ))
9+ self .url = str (input ("Enter the URL of video : " ))
1010 self .youtube = pytube .YouTube (
1111 self .url , on_progress_callback = YouTubeDownloder .onProgress
1212 )
@@ -28,14 +28,14 @@ def showStreams(self):
2828 self .chooseStream ()
2929
3030 def chooseStream (self ):
31- self .choose = int (input ("please select one : " ))
31+ self .choose = int (input ("Please select one : " ))
3232 self .validateChooseValue ()
3333
3434 def validateChooseValue (self ):
3535 if self .choose in range (1 , self .streamNo ):
3636 self .getStream ()
3737 else :
38- print ("please enter a correct option on the list." )
38+ print ("Please enter a correct option on the list." )
3939 self .chooseStream ()
4040
4141 def getStream (self ):
@@ -49,15 +49,15 @@ def getFileSize(self):
4949
5050 def getPermisionToContinue (self ):
5151 print (
52- "\n title : {0} \n author : {1} \n size : {2:.2f}MB \n resolution : {3} \n fps : {4} \n " .format (
52+ "\n Title : {0} \n Author : {1} \n Size : {2:.2f}MB \n Resolution : {3} \n FPS : {4} \n " .format (
5353 self .youtube .title ,
5454 self .youtube .author ,
5555 file_size ,
5656 self .stream .resolution ,
5757 self .stream .fps ,
5858 )
5959 )
60- if input ("do you want it ?(defualt = (y)es) or (n)o " ) == "n" :
60+ if input ("Do you want it ?(default = (y)es) or (n)o " ) == "n" :
6161 self .showStreams ()
6262 else :
6363 self .main ()
@@ -69,7 +69,7 @@ def download(self):
6969 def onProgress (stream = None , chunk = None , remaining = None ):
7070 file_downloaded = file_size - (remaining / 1000000 )
7171 print (
72- f"downloading ... { file_downloaded / file_size * 100 :0.2f} % [{ file_downloaded :.1f} MB of { file_size :.1f} MB]" ,
72+ f"Downloading ... { file_downloaded / file_size * 100 :0.2f} % [{ file_downloaded :.1f} MB of { file_size :.1f} MB]" ,
7373 end = "\r " ,
7474 )
7575
0 commit comments