GilbertClaus commited on
Commit
a9b61e8
·
1 Parent(s): df9c165

Update other.py

Browse files
Files changed (1) hide show
  1. other.py +8 -1
other.py CHANGED
@@ -61,4 +61,11 @@ def session(video_info, video_file, cut):
61
  file_name=st.session_state.video_file.split("/")[-1].title().replace('Mp4', 'mp4'),
62
  mime='application/octet-stream'
63
  )
64
-
 
 
 
 
 
 
 
 
61
  file_name=st.session_state.video_file.split("/")[-1].title().replace('Mp4', 'mp4'),
62
  mime='application/octet-stream'
63
  )
64
+
65
+ def convert_size(size_bytes):
66
+ units = ["B", "KB", "MB", "GB", "TB"]
67
+ index = 0
68
+ while size_bytes >= 1024 and index < len(units) - 1:
69
+ size_bytes /= 1024
70
+ index += 1
71
+ return f"{size_bytes:.2f} {units[index]}"