From 6b00766e796110272ed3ec8f7a4062b97406004c Mon Sep 17 00:00:00 2001 From: pythonboi Date: Wed, 1 Jun 2022 23:56:25 -0400 Subject: [PATCH] code updated --- file_placer.py | 45 ++++++++++++++++++++++++++------------- pytube_YoutubeDownload.py | 0 2 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 pytube_YoutubeDownload.py diff --git a/file_placer.py b/file_placer.py index 435ba12..f7f32fe 100644 --- a/file_placer.py +++ b/file_placer.py @@ -13,6 +13,7 @@ newfileExt = [] newSet = set() fullPath = '' +getExistingDir = '' if currentDirectory != chgeDirectory: os.chdir(chgeDirectory) @@ -76,31 +77,45 @@ except FileExistsError: print(f"{uniqFile} already exists ") - else: - print("No folder created") + for vryFile in lstDir: + #print(vryFile) + + if os.path.isfile(vryFile): + fullPath = os.path.join(chgeDirectory, vryFile) + print(f"{fullPath}, read this first") + + elif vryFile in fullPath and vryFile in getExistingDir: + print(f"{vryFile}, I exits on both path ") - for vryFile in lstDir: - if os.path.isfile(vryFile): - fullPath = os.path.join(chgeDirectory, vryFile) - for chkFolder in folderSide: + for chkFolder in folderSide: # print(chkFolder) - getExistingDir = os.path.join(chgeDirectory, chkFolder) + getExistingDir = os.path.join(chgeDirectory, chkFolder) - try: + try: + + for word in newSet: - for word in newSet: + if word in fullPath and word in getExistingDir: + print(shutil.move(fullPath, getExistingDir)) - if word in fullPath and word in getExistingDir: - print(shutil.move(fullPath, getExistingDir)) - except shutil.Error: - print("file already exits") + elif os.path.isfile(vryFile) and vryFile in getExistingDir: + print(f"{vryFile}, I am printing this") + + # elif vryFile in getExistingDir: + # print(f"{vryFile} already exists in directory") + except shutil.Error: + print("file already exits") + + else: + print("No folder created") # urlLink = "https://www.youtube.com/watch?v=n3IYVthup9I" # # urlLink2 = "https://www.youtube.com/watch?v=PAMpNhx4maM" urlLink3 = "https://www.youtube.com/watch?v=isRtFdu8sRs" -# -# + + + diff --git a/pytube_YoutubeDownload.py b/pytube_YoutubeDownload.py new file mode 100644 index 0000000..e69de29