From 22b1c95c390dde6d12ecb2cc45adf98b73cb7733 Mon Sep 17 00:00:00 2001 From: Skullheadx <704277@pdsb.net> Date: Sun, 25 Dec 2022 20:09:01 -0500 Subject: [PATCH] Youtuber Downloader --- .gitignore | 11 +++++++++++ dependencies.txt | 1 + links_file.txt | 0 main.py | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 .gitignore create mode 100644 dependencies.txt create mode 100644 links_file.txt create mode 100644 main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0094b45 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +.idea/ +examples.txt + diff --git a/dependencies.txt b/dependencies.txt new file mode 100644 index 0000000..cd5e770 --- /dev/null +++ b/dependencies.txt @@ -0,0 +1 @@ +pytube diff --git a/links_file.txt b/links_file.txt new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py new file mode 100644 index 0000000..05c1ce4 --- /dev/null +++ b/main.py @@ -0,0 +1,22 @@ +from pytube import YouTube + +SAVE_PATH = "D:/Youtube/CodingClub/" + +with open('links_file.txt', 'r') as f: + links = f.read().split('\n') + if links[-1] == "": + links = links[:-1] + + +def download(link): + yt = YouTube(link) + mp4_files = yt.streams.filter(file_extension="mp4") + mp4_files = mp4_files.get_highest_resolution() + mp4_files.download(output_path=SAVE_PATH) + print("Download is completed successfully") + + +for i in links: + download(i) + +print('Videos Downloaded!') -- 2.54.0