From bfca1b56ec3509a2dc5f7097f5e798998be2f3a2 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Sat, 11 Jun 2022 23:08:47 -0400 Subject: [PATCH] create a variable for the directory and print the current directory --- pytube_YoutubeDownload.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pytube_YoutubeDownload.py b/pytube_YoutubeDownload.py index 7b52ee2..5e87d6b 100644 --- a/pytube_YoutubeDownload.py +++ b/pytube_YoutubeDownload.py @@ -1,11 +1,15 @@ import os from pytube import YouTube -dirct = input("Please put the directory here: ") +print(os.getcwd()) -if os.getcwd() != dirct: +download_Dir = r"C:\Users\admin\Downloads" - os.chdir(dirct) +# dirct = input("Please put the directory here: ") + +if os.getcwd() != download_Dir: + + os.chdir(download_Dir) print(os.getcwd()) urlLink = input("Please paste your URL link here: ") @@ -13,11 +17,10 @@ y = YouTube(urlLink) adapt = y.streams.filter(adaptive=True) -print(adapt) +# print(adapt) dwn = y.streams.get_highest_resolution() - dwn.download() print(f"{dwn.title} download successfully and completed")