Skip to content

Commit a8851da

Browse files
authoredFeb 9, 2023
Add files via upload
1 parent e1cf989 commit a8851da

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
 

‎YouTube_Video_Downloader.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from pytube import YouTube
2+
from sys import argv
3+
4+
download_folder = 'E:/Quantum Computing/Qubit by Qubit (QxQ)/The Coding School and IBM Quantum course on Quantum Computing/Semester-2 - Spring 2023/Lecture Videos/'
5+
same_title = False
6+
title = ''
7+
8+
title = input('Enter desired title: ')
9+
10+
links_file = open('YouTube_links.txt')
11+
links = []
12+
for i in links_file:
13+
links.append(i[:-1])
14+
print('Total videos: {}'.format(len(links)))
15+
print('Downloading the video...')
16+
17+
for i in range(len(links)):
18+
link = links[i]
19+
yt = YouTube(link)
20+
21+
#yd2 = yt.streams.filter(res="720p")
22+
yd2 = yt.streams.get_highest_resolution()
23+
24+
#download_name = '{}-{}.mp4'.format(title, i+1)
25+
download_name = '{}.mp4'.format(title)
26+
27+
#print('Downloading Video-{}...'.format(i+1), end=' ')
28+
29+
# yd2[0].download(output_path=download_folder, filename=download_name)
30+
yd2.download(output_path=download_folder, filename=download_name)
31+
32+
print('-- Downloaded')

‎YouTube_links.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://www.youtube.com/watch?v=zBSo78VNNZ0&ab_channel=QubitbyQubit

0 commit comments

Comments
 (0)
Please sign in to comment.