This is the line of code:
names = os.listdir(SAVE_PATH + "/temp")
I tried to debug it and the names are an empty list [].
SAVE_PATH is imported from a different file and it is working properly
SAVE_PATH = r"C:\Users\rohit\Downloads\YouTube"
Edit: This worked:
print(os.listdir(r"C:\Users\rohit\Downloads\YouTube\temp"))
code link Thanks