-
-
Notifications
You must be signed in to change notification settings - Fork 268
Expand file tree
/
Copy pathlist_videos.py
More file actions
17 lines (12 loc) · 625 Bytes
/
list_videos.py
File metadata and controls
17 lines (12 loc) · 625 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#this script returns the list of videos (.mp4) from the path you choose.
import os
pathOfVideo=input("Enter the full path where videos are located.")
def array_Of_Videos():
fileExists= os.path.exists(pathOfVideo) #returns a boolen
if fileExists:
dirList= sorted(os.listdir(pathOfVideo)) #returns list of files inside the path
return [files for files in dirList if files.endswith(".mp4") ]
else:
print(f"No such path as {pathOfVideo}")
videoslist= array_Of_Videos()
print(f'If the sequence of the videos doesn\'t look like Following. You can press Control + C to kill the program.\n{videoslist}')