-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDownload - v1.2.py
More file actions
30 lines (23 loc) · 889 Bytes
/
Copy pathDownload - v1.2.py
File metadata and controls
30 lines (23 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
print('Youtube donwloader v1.2 script by Youssef Abdulaziz')
import os
os.system('python -m ensurepip --upgrade')
os.system('pip install yt-dlp')
print('Checking for dependencies...\n')
print('Checking complete!\n')
link = input('paste link here :' )
print('\nchoose format:\n1:audio [m4a]\n2:video [mp4]')
choice = input('\nselected format: ')
try:
if(choice == "1"):
os.system(f'yt-dlp -x --audio-format m4a {link}')
files = os.listdir('.')
for file in files:
pre, ext = os.path.splitext(file)
if(ext=='.webm'):
os.rename(file,f'{pre}.m4a')
else:
os.system(f"yt-dlp -x --format mp4 {link}")
print('Download Successful!')
except Exception as e:
print(f'An err occurred\nerr: {e}')
print('script unsuccessful')