We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 85b33ff + 39f07ce commit cf8c900Copy full SHA for cf8c900
Project-41-Video_to_audio_converter/main.py
@@ -0,0 +1,24 @@
1
+from pytube import YouTube
2
+import pytube
3
+import os
4
+
5
+def main():
6
+ video_url = input('Enter YouTube video URL: ')
7
8
+ if os.name == 'nt':
9
+ path = os.getcwd() + '\\'
10
+ else:
11
+ path = os.getcwd() + '/'
12
13
+ name = pytube.extract.video_id(video_url)
14
+ YouTube(video_url).streams.filter(only_audio=True).first().download(filename=name)
15
+ location = path + name + '.mp4'
16
+ renametomp3 = path + name + '.mp3'
17
18
19
+ os.system('ren {0} {1}'. format(location, renametomp3))
20
21
+ os.system('mv {0} {1}'. format(location, renametomp3))
22
23
+if __name__ == '__main__':
24
+ main()
0 commit comments