BinaryONe commited on
Commit
364bc51
·
1 Parent(s): 9766015

Callback Update

Browse files
FileStream/bot/plugins/FileHandlers/callback.py CHANGED
@@ -138,10 +138,10 @@ async def cb_data(bot: Client, update: CallbackQuery):
138
  "IMDB_id": get_imdb_id['results'][0]['id'],
139
  "poster": res['poster'],
140
  "title": res['name'],
 
141
  "type": res['type'],
142
  "description":res["description"],
143
  "genre":res["genre"]+[res["keywords"]],
144
- "quality":"Unknown",
145
  }
146
 
147
  file_info = get_file_info(message, instruction)
 
138
  "IMDB_id": get_imdb_id['results'][0]['id'],
139
  "poster": res['poster'],
140
  "title": res['name'],
141
+ "release_date":res["datePublished"],
142
  "type": res['type'],
143
  "description":res["description"],
144
  "genre":res["genre"]+[res["keywords"]],
 
145
  }
146
 
147
  file_info = get_file_info(message, instruction)
FileStream/bot/plugins/FileHandlers/stream.py CHANGED
@@ -64,6 +64,7 @@ async def private_receive_handler(bot: Client, message: Message):
64
  "IMDB_id": "Unknown",
65
  "poster": "Unknown",
66
  "title": "Unknown",
 
67
  "type": "Unknown",
68
  "description":"Unknown",
69
  "genre":"Unknown",
 
64
  "IMDB_id": "Unknown",
65
  "poster": "Unknown",
66
  "title": "Unknown",
67
+ "release_date":"unknown",
68
  "type": "Unknown",
69
  "description":"Unknown",
70
  "genre":"Unknown",
FileStream/utils/FileProcessors/file_properties.py CHANGED
@@ -13,7 +13,7 @@ from FileStream.bot import MULTI_CLIENTS
13
  from FileStream.Database import Database
14
  from FileStream.config import Telegram, Server
15
  from FileStream.Tools import Time_ISTKolNow
16
- from FileStream.Tools.cleanup import clean_text
17
 
18
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
19
 
@@ -187,7 +187,7 @@ def get_file_info(message, instruction):
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"
@@ -199,6 +199,7 @@ def get_file_info(message, instruction):
199
  "IMDB_id": instruction["IMDB_id"],
200
  "poster": instruction["poster"],
201
  "title": instruction["title"],
 
202
  "type": instruction["type"],
203
  "description":instruction["description"],
204
  "genre":instruction["genre"],
@@ -207,7 +208,7 @@ def get_file_info(message, instruction):
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", ""),
210
- "caption": clean_text(getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown"),
211
  "file_unique_id": getattr(media, "file_unique_id", ""),
212
  "file_name": get_name(message),
213
  "file_size": getattr(media, "file_size", 0),
 
13
  from FileStream.Database import Database
14
  from FileStream.config import Telegram, Server
15
  from FileStream.Tools import Time_ISTKolNow
16
+ from FileStream.Tools.cleanup import clean_text,clean_string_special
17
 
18
  db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME)
19
 
 
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= float(message.video.duration)
191
  else:
192
  quality ="Unknown"
193
  duration="unknown"
 
199
  "IMDB_id": instruction["IMDB_id"],
200
  "poster": instruction["poster"],
201
  "title": instruction["title"],
202
+ "release_date":instruction["release_date"],
203
  "type": instruction["type"],
204
  "description":instruction["description"],
205
  "genre":instruction["genre"],
 
208
  "location": message.from_user.id if (message.chat.type == ChatType.PRIVATE) else message.chat.id,
209
  "file": {
210
  "file_id": getattr(media, "file_id", ""),
211
+ "caption": clean_string_special(clean_text(getattr(message, "caption", f"{get_name(message)}" ) or "None/Unknown")),
212
  "file_unique_id": getattr(media, "file_unique_id", ""),
213
  "file_name": get_name(message),
214
  "file_size": getattr(media, "file_size", 0),