Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 deletions file_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
newfileExt = []
newSet = set()
fullPath = ''
getExistingDir = ''

if currentDirectory != chgeDirectory:
os.chdir(chgeDirectory)
Expand Down Expand Up @@ -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"
#
#



Empty file added pytube_YoutubeDownload.py
Empty file.