BinaryONe commited on
Commit ·
f5ebe15
1
Parent(s): 946dc05
Callback Update
Browse files
FileStream/utils/FileProcessors/file_properties.py
CHANGED
|
@@ -184,6 +184,13 @@ def get_file_info(message, instruction):
|
|
| 184 |
else:
|
| 185 |
user_idx = message.chat.id
|
| 186 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
#"caption": clean_text(getattr(message, "caption", f"{get_name(message)}")),
|
| 188 |
return {
|
| 189 |
"user_id": instruction['user_id'],
|
|
@@ -195,7 +202,8 @@ def get_file_info(message, instruction):
|
|
| 195 |
"type": instruction["type"],
|
| 196 |
"description":instruction["description"],
|
| 197 |
"genre":instruction["genre"],
|
| 198 |
-
"quality":
|
|
|
|
| 199 |
"location": message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
|
| 200 |
"file": {
|
| 201 |
"file_id": getattr(media, "file_id", ""),
|
|
|
|
| 184 |
else:
|
| 185 |
user_idx = message.chat.id
|
| 186 |
"""
|
| 187 |
+
# Check if message contains a video and extract height/width
|
| 188 |
+
if hasattr(message, "video") and message.video:
|
| 189 |
+
quality = f"{message.video.height}x{message.video.width}"
|
| 190 |
+
duration= message.video.duration,
|
| 191 |
+
else:
|
| 192 |
+
quality ="Unknown"
|
| 193 |
+
duration="unknown"
|
| 194 |
#"caption": clean_text(getattr(message, "caption", f"{get_name(message)}")),
|
| 195 |
return {
|
| 196 |
"user_id": instruction['user_id'],
|
|
|
|
| 202 |
"type": instruction["type"],
|
| 203 |
"description":instruction["description"],
|
| 204 |
"genre":instruction["genre"],
|
| 205 |
+
"quality":quality,
|
| 206 |
+
"duration": duration,
|
| 207 |
"location": message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
|
| 208 |
"file": {
|
| 209 |
"file_id": getattr(media, "file_id", ""),
|