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
33 changes: 18 additions & 15 deletions file_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@

newFolder = input("Please Enter the name of the new Folder: ").title()

try:
os.mkdir(newFolder)
print(f"{newFolder} created successful")

except FileExistsError:
print(f"{newFolder} already exists")

else:

if os.path.exists(chgeDirectory):

lstDir = os.listdir(os.getcwd())
Expand All @@ -39,12 +48,12 @@
else:
fileSide.append(check)

if newFolder not in folderSide:
os.mkdir(newFolder)

print(f"{newFolder} folder created successful")
else:
print(f"{newFolder} folder already exits")
# if newFolder not in folderSide:
# os.mkdir(newFolder)
#
# print(f"{newFolder} folder created successful")
# else:
# print(f"{newFolder} folder already exits")

# Differentiate the file from the extension

Expand Down Expand Up @@ -78,7 +87,7 @@
print(f"{uniqFile} already exists ")

for vryFile in lstDir:
#print(vryFile)
# print(vryFile)

if os.path.isfile(vryFile):
fullPath = os.path.join(chgeDirectory, vryFile)
Expand All @@ -87,10 +96,8 @@
elif vryFile in fullPath and vryFile in getExistingDir:
print(f"{vryFile}, I exits on both path ")



for chkFolder in folderSide:
# print(chkFolder)
# print(chkFolder)
getExistingDir = os.path.join(chgeDirectory, chkFolder)

try:
Expand All @@ -108,14 +115,10 @@
except shutil.Error:
print("file already exits")

else:
print("No folder created")
# 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"



23 changes: 23 additions & 0 deletions pytube_YoutubeDownload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from pytube import YouTube

dirct = input("Please put the directory here: ")

if os.getcwd() != dirct:

os.chdir(dirct)
print(os.getcwd())

urlLink = input("Please paste your URL link here: ")

y = YouTube(urlLink)

adapt = y.streams.filter(adaptive=True)
print(adapt)

dwn = y.streams.get_highest_resolution()


dwn.download()

print(f"{dwn.title} download successfully and completed")