fix clean string

This commit is contained in:
yuvraj
2024-02-23 22:10:45 +04:00
parent c7c865fc39
commit 267c5ec70b
+2 -4
View File
@@ -1,11 +1,9 @@
import imageio
import re
def get_video_metadata(video_path):
reader = imageio.get_reader(video_path)
return reader.get_meta_data()
def clean_string(input_string):
invalid_chars = ['\\', '/', ':', '*', '?', '"', '<', '>', '|',"#"," ","!"]
cleaned_string = ''.join(c if c not in invalid_chars else '_' for c in input_string)
cleaned_string = cleaned_string.strip(" .")
return cleaned_string
return re.sub("[^A-Za-z]", "", s)