6
6
7
7
class YouTubeDownloder :
8
8
def __init__ (self ):
9
- self .url = str (input ("Enter the url of video : " ))
9
+ self .url = str (input ("Enter the URL of video : " ))
10
10
self .youtube = pytube .YouTube (
11
11
self .url , on_progress_callback = YouTubeDownloder .onProgress
12
12
)
@@ -28,14 +28,14 @@ def showStreams(self):
28
28
self .chooseStream ()
29
29
30
30
def chooseStream (self ):
31
- self .choose = int (input ("please select one : " ))
31
+ self .choose = int (input ("Please select one : " ))
32
32
self .validateChooseValue ()
33
33
34
34
def validateChooseValue (self ):
35
35
if self .choose in range (1 , self .streamNo ):
36
36
self .getStream ()
37
37
else :
38
- print ("please enter a correct option on the list." )
38
+ print ("Please enter a correct option on the list." )
39
39
self .chooseStream ()
40
40
41
41
def getStream (self ):
@@ -49,15 +49,15 @@ def getFileSize(self):
49
49
50
50
def getPermisionToContinue (self ):
51
51
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 (
53
53
self .youtube .title ,
54
54
self .youtube .author ,
55
55
file_size ,
56
56
self .stream .resolution ,
57
57
self .stream .fps ,
58
58
)
59
59
)
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" :
61
61
self .showStreams ()
62
62
else :
63
63
self .main ()
@@ -69,7 +69,7 @@ def download(self):
69
69
def onProgress (stream = None , chunk = None , remaining = None ):
70
70
file_downloaded = file_size - (remaining / 1000000 )
71
71
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]" ,
73
73
end = "\r " ,
74
74
)
75
75
0 commit comments