34 lines
778 B
Python
34 lines
778 B
Python
# Source - https://stackoverflow.com/a
|
|
# Posted by anselm, modified by community. See post 'Timeline' for change history
|
|
# Retrieved 2025-11-30, License - CC BY-SA 4.0
|
|
|
|
import sys
|
|
import os
|
|
|
|
def list_bad_files_in_dir(directory_name, file_type="mp4"):
|
|
|
|
directory = os.fsencode(directory_name)
|
|
|
|
for file in os.listdir(directory):
|
|
filename = os.fsdecode(file)
|
|
if filename.endswith(f".{file_type}"):
|
|
print(filename)
|
|
continue
|
|
else:
|
|
continue
|
|
|
|
def main():
|
|
|
|
program_name = sys.argv[0]
|
|
|
|
if len(sys.argv) != 2:
|
|
print(f"Usage: {program_name} <target directory>")
|
|
return 1
|
|
|
|
target_directory = sys.argv[1]
|
|
|
|
list_bad_files_in_dir(target_directory)
|
|
|
|
if __name__ == "__main__":
|
|
main()
|